Compare commits
5 Commits
a80e2acfdb
...
890433fc34
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
890433fc34 | ||
|
|
629b6ad13e | ||
|
|
8ead3de94c | ||
|
|
ca3e41a501 | ||
|
|
7253bfe232 |
@ -55,4 +55,23 @@ public class BaseConstants {
|
||||
public static final String ARCHIVES_TYPE = "archives_type";
|
||||
/**卡片关联关系主表*/
|
||||
public static final String ACTIVE_RULE_COUPON_ACTIVE = "dl_active_main";
|
||||
/**卡券积分变更记录-充值*/
|
||||
public static final String BALANCE_CHANGE_TYPE_CZ = "cz";
|
||||
/**卡券积分变更记录-退款*/
|
||||
public static final String BALANCE_CHANGE_TYPE_TK = "tk";
|
||||
/**卡券积分变更记录-消费*/
|
||||
public static final String BALANCE_CHANGE_TYPE_XF = "xf";
|
||||
/**卡券积分变更记录-赠送*/
|
||||
public static final String BALANCE_CHANGE_TYPE_ZS = "zs";
|
||||
/**卡券积分变更记录-卡券核销*/
|
||||
public static final String BALANCE_CHANGE_TYPE_KQHX = "kqhx";
|
||||
/**卡券积分变更主体-余额*/
|
||||
public static final String BALANCE_CHANGE_MAIN_YE = "ye";
|
||||
/**卡券积分变更主体-卡券*/
|
||||
public static final String BALANCE_CHANGE_MAIN_KQ = "kq";
|
||||
/**卡券积分变更核销规则-计次*/
|
||||
public static final String BALANCE_CHANGE_RULE_JC = "jc";
|
||||
/**卡券积分变更核销规则-金额*/
|
||||
public static final String BALANCE_CHANGE_RULE_ME = "je";
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerActiveService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActivePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActiveRespVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActiveSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 用户参与活动记录")
|
||||
@RestController
|
||||
@RequestMapping("/base/customer-active")
|
||||
@Validated
|
||||
public class CustomerActiveController {
|
||||
|
||||
@Resource
|
||||
private CustomerActiveService customerActiveService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户参与活动记录")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-active:create')")
|
||||
public CommonResult<String> createCustomerActive(@Valid @RequestBody CustomerActiveSaveReqVO createReqVO) {
|
||||
return success(customerActiveService.createCustomerActive(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户参与活动记录")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-active:update')")
|
||||
public CommonResult<Boolean> updateCustomerActive(@Valid @RequestBody CustomerActiveSaveReqVO updateReqVO) {
|
||||
customerActiveService.updateCustomerActive(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户参与活动记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-active:delete')")
|
||||
public CommonResult<Boolean> deleteCustomerActive(@RequestParam("id") String id) {
|
||||
customerActiveService.deleteCustomerActive(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户参与活动记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-active:query')")
|
||||
public CommonResult<CustomerActiveRespVO> getCustomerActive(@RequestParam("id") String id) {
|
||||
CustomerActive customerActive = customerActiveService.getCustomerActive(id);
|
||||
return success(BeanUtils.toBean(customerActive, CustomerActiveRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户参与活动记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-active:query')")
|
||||
public CommonResult<PageResult<CustomerActiveRespVO>> getCustomerActivePage(@Valid CustomerActivePageReqVO pageReqVO) {
|
||||
PageResult<CustomerActive> pageResult = customerActiveService.getCustomerActivePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CustomerActiveRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerBalanceChangeService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 用户积分(余额)、卡券变动记录")
|
||||
@RestController
|
||||
@RequestMapping("/base/customer-balance-change")
|
||||
@Validated
|
||||
public class CustomerBalanceChangeController {
|
||||
|
||||
@Resource
|
||||
private CustomerBalanceChangeService customerBalanceChangeService;
|
||||
|
||||
/**
|
||||
* 分页查询变更记录
|
||||
*
|
||||
* @param pageReqVO CustomerBalanceChangePageReqVO实体
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < ?>>
|
||||
* @author PQZ
|
||||
* @date 22:37 2024/9/20
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户积分(余额)、卡券变动记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-balance-change:query')")
|
||||
public CommonResult<IPage<?>> getCustomerBalanceChangePage(CustomerBalanceChangePageReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<CustomerBalanceChangeRespVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(customerBalanceChangeService.queryListPage(pageReqVO,page));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceSaveReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 用户积分(余额)")
|
||||
@RestController
|
||||
@RequestMapping("/base/customer-balance")
|
||||
@Validated
|
||||
public class CustomerBalanceController {
|
||||
|
||||
@Resource
|
||||
private CustomerBalanceService customerBalanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户积分(余额)")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-balance:create')")
|
||||
public CommonResult<String> createCustomerBalance(@Valid @RequestBody CustomerBalanceSaveReqVO createReqVO) {
|
||||
return success(customerBalanceService.createCustomerBalance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户积分(余额)")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-balance:update')")
|
||||
public CommonResult<Boolean> updateCustomerBalance(@Valid @RequestBody CustomerBalanceSaveReqVO updateReqVO) {
|
||||
customerBalanceService.updateCustomerBalance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerCouponService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponPageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 用户卡券")
|
||||
@RestController
|
||||
@RequestMapping("/base/customer-coupon")
|
||||
@Validated
|
||||
public class CustomerCouponController {
|
||||
|
||||
@Resource
|
||||
private CustomerCouponService customerCouponService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户卡券")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-coupon:create')")
|
||||
public CommonResult<String> createCustomerCoupon(@Valid @RequestBody CustomerCouponSaveReqVO createReqVO) {
|
||||
return success(customerCouponService.createCustomerCoupon(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户卡券")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-coupon:update')")
|
||||
public CommonResult<Boolean> updateCustomerCoupon(@Valid @RequestBody CustomerCouponSaveReqVO updateReqVO) {
|
||||
customerCouponService.updateCustomerCoupon(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户卡券
|
||||
* @author PQZ
|
||||
* @date 22:57 2024/9/20
|
||||
* @param id TODO
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
|
||||
**/
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户卡券")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-coupon:delete')")
|
||||
public CommonResult<Boolean> deleteCustomerCoupon(@RequestParam("id") String id) {
|
||||
customerCouponService.deleteCustomerCoupon(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取卡券信息及当前消费记录
|
||||
* @author PQZ
|
||||
* @date 22:56 2024/9/20
|
||||
* @param id 用户卡券id
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO>
|
||||
**/
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户卡券")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-coupon:query')")
|
||||
public CommonResult<CustomerCouponRespVO> getCustomerCoupon(@RequestParam("id") String id) {
|
||||
return success(customerCouponService.getCustomerCoupon(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户卡券分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-coupon:query')")
|
||||
public CommonResult<PageResult<CustomerCouponRespVO>> getCustomerCouponPage(@Valid CustomerCouponPageReqVO pageReqVO) {
|
||||
PageResult<CustomerCoupon> pageResult = customerCouponService.getCustomerCouponPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CustomerCouponRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.custom.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 用户参与活动记录 DO
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@TableName("base_customer_active")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerActive extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private String cusId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 参加活动id
|
||||
*/
|
||||
private String activeId;
|
||||
/**
|
||||
* 参加活动名称
|
||||
*/
|
||||
private String activeName;
|
||||
/**
|
||||
* 参加活动类型(数据字典)
|
||||
*/
|
||||
private String activeType;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.custom.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户积分(余额) DO
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@TableName("base_customer_balance")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerBalance extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private String cusId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 积分余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 冻结积分
|
||||
*/
|
||||
private BigDecimal forzeBalance;
|
||||
/**
|
||||
* 累计充值额度
|
||||
*/
|
||||
private BigDecimal allBalance;
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.custom.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户积分(余额)、卡券变动记录 DO
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@TableName("base_customer_balance_change")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerBalanceChange extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private String cusId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 关联卡券id
|
||||
*/
|
||||
private String couponId;
|
||||
/**
|
||||
* 变动类型(充值、消费、退款、赠送、卡券核销)
|
||||
*/
|
||||
private String changeType;
|
||||
/**
|
||||
* 变动主体(余额、卡券)
|
||||
*/
|
||||
private String changeMain;
|
||||
/**
|
||||
* 变动规则(计次、面额)
|
||||
*/
|
||||
private String changeRule;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
private BigDecimal changeBalance;
|
||||
/**
|
||||
* 变动后剩余积分
|
||||
*/
|
||||
private BigDecimal remBalance;
|
||||
/**
|
||||
* 变动原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.custom.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 用户卡券 DO
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@TableName("base_customer_coupon")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerCoupon extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private String cusId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 卡券id
|
||||
*/
|
||||
private String couponId;
|
||||
/**
|
||||
* 来源活动id
|
||||
*/
|
||||
private String activeId;
|
||||
/**
|
||||
* 卡券面额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 剩余额度
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
/**
|
||||
* 计次
|
||||
*/
|
||||
private Integer useNum;
|
||||
/**
|
||||
* 核销方式(计次核销、面额核销、一次性核销)
|
||||
*/
|
||||
private String outRule;
|
||||
/**
|
||||
* 是否有效(0否1是)
|
||||
*/
|
||||
private String isValid;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.custom.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户参与活动记录 Mapper
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerActiveMapper extends BaseMapper<CustomerActive> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.custom.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 用户积分(余额)、卡券变动记录 Mapper
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerBalanceChangeMapper extends BaseMapper<CustomerBalanceChange> {
|
||||
|
||||
/**
|
||||
* @param entity CustomerBalanceChangePageReqVO实体
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO>
|
||||
* @author PQZ
|
||||
* @date 22:40 2024/9/20
|
||||
**/
|
||||
IPage<CustomerBalanceChangeRespVO> queryListPage(@Param("entity") CustomerBalanceChangePageReqVO entity, Page<CustomerBalanceChangeRespVO> page);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.custom.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户积分(余额) Mapper
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerBalanceMapper extends BaseMapper<CustomerBalance> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.custom.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户积分(余额) Mapper
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerCouponMapper extends BaseMapper<CustomerCoupon> {
|
||||
|
||||
/**
|
||||
* 根据用户id获取卡券信息
|
||||
*
|
||||
* @param cusId 用户id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO>
|
||||
* @author PQZ
|
||||
* @date 20:44 2024/9/20
|
||||
**/
|
||||
List<CustomerCouponRespVO> listByCusId(@Param("cusId") String cusId);
|
||||
|
||||
}
|
||||
@ -27,4 +27,13 @@ public interface CustomerMainMapper extends BaseMapper<CustomerMain> {
|
||||
* @date 15:01 2024/8/1
|
||||
**/
|
||||
IPage<CustomerMainRespVO> selectListPage(@Param("entity") CustomerMainPageReqVO pageReqVO, Page<CustomerMainRespVO> page);
|
||||
|
||||
/**
|
||||
* 通过id查询客户信息
|
||||
* @author PQZ
|
||||
* @date 19:34 2024/9/20
|
||||
* @param id 客户id
|
||||
* @return cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO
|
||||
**/
|
||||
CustomerMainRespVO queryById(@Param("id") String id);
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.custom.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActivePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActiveSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户参与活动记录 Service 接口
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
public interface CustomerActiveService extends IService<CustomerActive> {
|
||||
|
||||
/**
|
||||
* 创建用户参与活动记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createCustomerActive(@Valid CustomerActiveSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户参与活动记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCustomerActive(@Valid CustomerActiveSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除用户参与活动记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCustomerActive(String id);
|
||||
|
||||
/**
|
||||
* 获得用户参与活动记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 用户参与活动记录
|
||||
*/
|
||||
CustomerActive getCustomerActive(String id);
|
||||
|
||||
/**
|
||||
* 获得用户参与活动记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户参与活动记录分页
|
||||
*/
|
||||
PageResult<CustomerActive> getCustomerActivePage(CustomerActivePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.custom.service;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户积分(余额)、卡券变动记录 Service 接口
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
public interface CustomerBalanceChangeService extends IService<CustomerBalanceChange> {
|
||||
|
||||
/**
|
||||
* @param cusId 客户id
|
||||
* @param userId 用户id
|
||||
* @param couponId 关联卡券id
|
||||
* @param changeType 变动类型
|
||||
* @param changeMain 变动主体
|
||||
* @param changeRule 变动规则
|
||||
* @param changeBalance 变动积分/次数
|
||||
* @param remBalance 变动后剩余积分/次数
|
||||
* @param reason 变动原因
|
||||
* @author PQZ
|
||||
* @date 21:54 2024/9/20
|
||||
**/
|
||||
void saveChange(String cusId, Integer userId, String couponId, String changeType, String changeMain, String changeRule, BigDecimal changeBalance, BigDecimal remBalance, String reason);
|
||||
|
||||
|
||||
/**
|
||||
* 获得用户积分(余额)、卡券变动记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户积分(余额)、卡券变动记录分页
|
||||
*/
|
||||
IPage<CustomerBalanceChangeRespVO> queryListPage(CustomerBalanceChangePageReqVO pageReqVO, Page<CustomerBalanceChangeRespVO> page);
|
||||
|
||||
/**
|
||||
* 通过用户id和卡券id查询积分、卡券的变动记录
|
||||
*
|
||||
* @param cusId 用户id
|
||||
* @param couponId 卡券id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange>
|
||||
* @author PQZ
|
||||
* @date 22:48 2024/9/20
|
||||
**/
|
||||
List<CustomerBalanceChange> getCouponChange(String cusId, String couponId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.custom.service;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户积分(余额) Service 接口
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
public interface CustomerBalanceService extends IService<CustomerBalance> {
|
||||
|
||||
/**
|
||||
* 创建用户积分(余额)
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createCustomerBalance(@Valid CustomerBalanceSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户积分(余额)
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCustomerBalance(@Valid CustomerBalanceSaveReqVO updateReqVO);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.custom.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponPageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户卡券 Service 接口
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
public interface CustomerCouponService extends IService<CustomerCoupon> {
|
||||
|
||||
/**
|
||||
* 创建用户卡券
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createCustomerCoupon(@Valid CustomerCouponSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户卡券
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCustomerCoupon(@Valid CustomerCouponSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除用户卡券
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCustomerCoupon(String id);
|
||||
|
||||
/**
|
||||
* 获取用户卡券信息及卡券变动信息
|
||||
* @author PQZ
|
||||
* @date 22:51 2024/9/20
|
||||
* @param id 用户卡券id
|
||||
* @return cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO
|
||||
**/
|
||||
CustomerCouponRespVO getCustomerCoupon(String id);
|
||||
|
||||
/**
|
||||
* 获得用户卡券分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户卡券分页
|
||||
*/
|
||||
PageResult<CustomerCoupon> getCustomerCouponPage(CustomerCouponPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 根据用户id获取卡券信息
|
||||
* @author PQZ
|
||||
* @date 20:43 2024/9/20
|
||||
* @param cusId 用户id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO>
|
||||
**/
|
||||
List<CustomerCouponRespVO> listByCusId(String cusId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.custom.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import cn.iocoder.yudao.module.custom.mapper.CustomerActiveMapper;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerActiveService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActivePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerActiveSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 用户参与活动记录 Service 实现类
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CustomerActiveServiceImpl extends ServiceImpl<CustomerActiveMapper, CustomerActive> implements CustomerActiveService {
|
||||
|
||||
@Resource
|
||||
private CustomerActiveMapper customerActiveMapper;
|
||||
|
||||
@Override
|
||||
public String createCustomerActive(CustomerActiveSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CustomerActive customerActive = BeanUtils.toBean(createReqVO, CustomerActive.class);
|
||||
customerActiveMapper.insert(customerActive);
|
||||
// 返回
|
||||
return customerActive.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCustomerActive(CustomerActiveSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
CustomerActive updateObj = BeanUtils.toBean(updateReqVO, CustomerActive.class);
|
||||
customerActiveMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCustomerActive(String id) {
|
||||
// 删除
|
||||
customerActiveMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public CustomerActive getCustomerActive(String id) {
|
||||
return customerActiveMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CustomerActive> getCustomerActivePage(CustomerActivePageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.custom.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import cn.iocoder.yudao.module.custom.mapper.CustomerBalanceChangeMapper;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerBalanceChangeService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeSaveReqVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户积分(余额)、卡券变动记录 Service 实现类
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CustomerBalanceChangeServiceImpl extends ServiceImpl<CustomerBalanceChangeMapper, CustomerBalanceChange> implements CustomerBalanceChangeService {
|
||||
|
||||
@Resource
|
||||
private CustomerBalanceChangeMapper customerBalanceChangeMapper;
|
||||
|
||||
|
||||
/**
|
||||
* @param cusId 客户id
|
||||
* @param userId 用户id
|
||||
* @param couponId 关联卡券id
|
||||
* @param changeType 变动类型
|
||||
* @param changeMain 变动主体
|
||||
* @param changeRule 变动规则
|
||||
* @param changeBalance 变动积分/次数
|
||||
* @param remBalance 变动后剩余积分/次数
|
||||
* @param reason 变动原因
|
||||
* @author PQZ
|
||||
* @date 21:54 2024/9/20
|
||||
**/
|
||||
@Override
|
||||
public void saveChange(String cusId, Integer userId, String couponId, String changeType, String changeMain, String changeRule, BigDecimal changeBalance, BigDecimal remBalance, String reason) {
|
||||
CustomerBalanceChange change = new CustomerBalanceChange();
|
||||
change.setCusId(cusId);
|
||||
change.setUserId(userId);
|
||||
change.setCouponId(couponId);
|
||||
change.setChangeType(changeType);
|
||||
change.setChangeMain(changeMain);
|
||||
change.setChangeRule(changeRule);
|
||||
change.setChangeBalance(changeBalance);
|
||||
change.setRemBalance(remBalance);
|
||||
change.setReason(reason);
|
||||
save(change);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得用户积分(余额)、卡券变动记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @param page 分页参数
|
||||
* @return 用户积分(余额)、卡券变动记录分页
|
||||
*/
|
||||
@Override
|
||||
public IPage<CustomerBalanceChangeRespVO> queryListPage(CustomerBalanceChangePageReqVO pageReqVO, Page<CustomerBalanceChangeRespVO> page) {
|
||||
return customerBalanceChangeMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户id和卡券id查询积分、卡券的变动记录
|
||||
*
|
||||
* @param cusId 用户id
|
||||
* @param couponId 卡券id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange>
|
||||
* @author PQZ
|
||||
* @date 22:48 2024/9/20
|
||||
**/
|
||||
@Override
|
||||
public List<CustomerBalanceChange> getCouponChange(String cusId, String couponId) {
|
||||
LambdaQueryWrapper<CustomerBalanceChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CustomerBalanceChange::getCusId,cusId)
|
||||
.eq(CustomerBalanceChange::getCouponId,couponId)
|
||||
.eq(BaseDO::getDeleted,'0');
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.custom.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
|
||||
import cn.iocoder.yudao.module.custom.mapper.CustomerBalanceMapper;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 用户积分(余额) Service 实现类
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMapper, CustomerBalance> implements CustomerBalanceService {
|
||||
|
||||
@Resource
|
||||
private CustomerBalanceMapper customerBalanceMapper;
|
||||
|
||||
@Override
|
||||
public String createCustomerBalance(CustomerBalanceSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CustomerBalance customerBalance = BeanUtils.toBean(createReqVO, CustomerBalance.class);
|
||||
customerBalanceMapper.insert(customerBalance);
|
||||
// 返回
|
||||
return customerBalance.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCustomerBalance(CustomerBalanceSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
CustomerBalance updateObj = BeanUtils.toBean(updateReqVO, CustomerBalance.class);
|
||||
customerBalanceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.custom.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import cn.iocoder.yudao.module.custom.mapper.CustomerCouponMapper;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerBalanceChangeService;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerCouponService;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponPageReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerCouponSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户卡券 Service 实现类
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CustomerCouponServiceImpl extends ServiceImpl<CustomerCouponMapper, CustomerCoupon> implements CustomerCouponService {
|
||||
|
||||
@Resource
|
||||
private CustomerCouponMapper customerCouponMapper;
|
||||
@Resource
|
||||
private CustomerBalanceChangeService changeService;
|
||||
|
||||
@Override
|
||||
public String createCustomerCoupon(CustomerCouponSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CustomerCoupon customerCoupon = BeanUtils.toBean(createReqVO, CustomerCoupon.class);
|
||||
customerCouponMapper.insert(customerCoupon);
|
||||
// 返回
|
||||
return customerCoupon.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCustomerCoupon(CustomerCouponSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
CustomerCoupon updateObj = BeanUtils.toBean(updateReqVO, CustomerCoupon.class);
|
||||
customerCouponMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCustomerCoupon(String id) {
|
||||
// 删除
|
||||
customerCouponMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户卡券信息及卡券变动信息
|
||||
* @author PQZ
|
||||
* @date 22:51 2024/9/20
|
||||
* @param id 用户卡券id
|
||||
* @return cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO
|
||||
**/
|
||||
@Override
|
||||
public CustomerCouponRespVO getCustomerCoupon(String id) {
|
||||
CustomerCoupon coupon = getById(id);
|
||||
CustomerCouponRespVO result = BeanUtils.toBean(coupon,CustomerCouponRespVO.class);
|
||||
List<CustomerBalanceChange> changeList = changeService.getCouponChange(coupon.getCusId(),coupon.getCouponId());
|
||||
result.setChangeList(changeList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CustomerCoupon> getCustomerCouponPage(CustomerCouponPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id获取卡券信息
|
||||
*
|
||||
* @param cusId 用户id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO>
|
||||
* @author PQZ
|
||||
* @date 20:43 2024/9/20
|
||||
**/
|
||||
@Override
|
||||
public List<CustomerCouponRespVO> listByCusId(String cusId) {
|
||||
return customerCouponMapper.listByCusId(cusId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||
import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper;
|
||||
import cn.iocoder.yudao.module.custom.mapper.CustomerMainMapper;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerCarService;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerCouponService;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerItemService;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
|
||||
import cn.iocoder.yudao.module.custom.vo.*;
|
||||
@ -70,6 +71,8 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
private PermissionApi permissionApi;
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
@Resource
|
||||
private CustomerCouponService customerCouponService;
|
||||
|
||||
/**
|
||||
* 客户管理分页列表查询
|
||||
@ -90,7 +93,6 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
*
|
||||
* @param saveReqVO 保存客户信息扩展实体
|
||||
* @param sign 标识(新增客户created/编辑客户update)
|
||||
* @return void
|
||||
* @author PQZ
|
||||
* @date 15:46 2024/8/1
|
||||
**/
|
||||
@ -170,19 +172,21 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
@Override
|
||||
public CustomerMainRespVO getCustomerById(String id) {
|
||||
/*1、主表信息*/
|
||||
CustomerMain main = this.getById(id);
|
||||
CustomerMainRespVO result = customerMainMapper.queryById(id);
|
||||
/*2、扩展表信息*/
|
||||
LambdaQueryWrapper<CustomerItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BaseDO::getDeleted, 0).eq(CustomerItem::getCusId, id);
|
||||
List<CustomerItem> itemList = customerItemService.list(lambdaQueryWrapper);
|
||||
/*3、车辆信息*/
|
||||
List<CarMainRespVO> carList = customerCarMapper.selectCarListByCusId(id);
|
||||
CustomerMainRespVO result = JSONUtil.toBean(JSONUtil.parseObj(main).toJSONString(0), CustomerMainRespVO.class);
|
||||
result.setItemList(itemList);
|
||||
result.setCarList(carList);
|
||||
/*4、标签信息*/
|
||||
List<BusiLabel> labelList = busiLabelService.listByMainId(id);
|
||||
result.setLabelList(labelList);
|
||||
/*5、卡券信息*/
|
||||
List<CustomerCouponRespVO> couponList = customerCouponService.listByCusId(id);
|
||||
result.setCouponList(couponList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 用户参与活动记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerActivePageReqVO extends CustomerActive {
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 用户参与活动记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CustomerActiveRespVO extends CustomerActive {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerActive;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户参与活动记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class CustomerActiveSaveReqVO extends CustomerActive {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分(余额)、卡券变动记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerBalanceChangePageReqVO extends CustomerBalanceChange {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分(余额)、卡券变动记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CustomerBalanceChangeRespVO extends CustomerBalanceChange {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分(余额)、卡券变动记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class CustomerBalanceChangeSaveReqVO extends CustomerBalanceChange {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分(余额)分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerBalancePageReqVO extends CustomerBalance {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分(余额) Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CustomerBalanceRespVO extends CustomerBalance {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分(余额)新增/修改 Request VO")
|
||||
@Data
|
||||
public class CustomerBalanceSaveReqVO extends CustomerBalance {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户卡券分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerCouponPageReqVO extends CustomerCoupon {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户卡券 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CustomerCouponRespVO extends CustomerCoupon {
|
||||
/**
|
||||
* 卡券名称
|
||||
*/
|
||||
private String couponName;
|
||||
/**
|
||||
* 卡券类型(保养卡、服务券、礼包券)
|
||||
*/
|
||||
private String couponType;
|
||||
/**
|
||||
* 适用车型(数据字典)
|
||||
*/
|
||||
private String carModel;
|
||||
/**
|
||||
* 开始有效期
|
||||
*/
|
||||
private LocalDateTime beginTime;
|
||||
/**
|
||||
* 结束有效期
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 效果图片
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 来源活动名称
|
||||
*/
|
||||
private String activeName;
|
||||
|
||||
private List<CustomerBalanceChange> changeList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 用户卡券新增/修改 Request VO")
|
||||
@Data
|
||||
public class CustomerCouponSaveReqVO extends CustomerCoupon {
|
||||
|
||||
|
||||
}
|
||||
@ -7,6 +7,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 客户管理 Response VO")
|
||||
@ -28,10 +29,18 @@ public class CustomerMainRespVO extends CustomerMain {
|
||||
List<BusiLabel> labelList;
|
||||
/**车辆品牌型号数组*/
|
||||
List<String> brandAndModel;
|
||||
/**关联卡券信息*/
|
||||
List<CustomerCouponRespVO> couponList;
|
||||
/**会员名称 */
|
||||
private String levelName;
|
||||
|
||||
/**是否车主(0否1是)*/
|
||||
private String isOwner;
|
||||
/**积分余额*/
|
||||
private BigDecimal balance;
|
||||
/**冻结积分*/
|
||||
private BigDecimal forzeBalance;
|
||||
/**累计充值额度*/
|
||||
private BigDecimal allBalance;
|
||||
|
||||
|
||||
}
|
||||
@ -15,5 +15,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ActiveMainPageReqVO extends ActiveMain {
|
||||
|
||||
/**用于判断是否查询当前时间段可参与的活动*/
|
||||
private String isNow;
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?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="cn.iocoder.yudao.module.custom.mapper.CustomerActiveMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,31 @@
|
||||
<?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="cn.iocoder.yudao.module.custom.mapper.CustomerBalanceChangeMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="queryListPage" resultType="cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO">
|
||||
SELECT
|
||||
bcbc.*
|
||||
FROM
|
||||
base_customer_balance_change bcbc
|
||||
<where>
|
||||
bcbc.delete = '0'
|
||||
<if test="entity.cusId != null and entity.cusId != ''">
|
||||
AND bcbc.cus_id = #{entity.cusId}
|
||||
</if>
|
||||
<if test="entity.userId != null">
|
||||
AND bcbc.user_id = #{entity.userId}
|
||||
</if>
|
||||
<if test="entity.couponId != null and entity.couponId != ''">
|
||||
AND bcbc.coupon_id = #{entity.couponId}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,12 @@
|
||||
<?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="cn.iocoder.yudao.module.custom.mapper.CustomerBalanceMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,32 @@
|
||||
<?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="cn.iocoder.yudao.module.custom.mapper.CustomerCouponMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="listByCusId" resultType="cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO">
|
||||
SELECT
|
||||
bcc.*,
|
||||
dmc.`name` AS couponName,
|
||||
dmc.type AS couponType,
|
||||
dmc.car_model AS carModel,
|
||||
dmc.begin_time AS beginTime,
|
||||
dmc.end_time AS endTime,
|
||||
dmc.image AS image,
|
||||
dam.NAME AS activeName
|
||||
FROM
|
||||
base_customer_coupon bcc
|
||||
LEFT JOIN dl_member_coupon dmc ON bcc.coupon_id = dmc.id
|
||||
AND dmc.deleted = 0
|
||||
LEFT JOIN dl_active_main dam ON bcc.active_id = dam.id
|
||||
AND dam.deleted = 0
|
||||
WHERE
|
||||
bcc.cus_id = #{cusId}
|
||||
AND bcc.deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@ -41,7 +41,7 @@
|
||||
FROM
|
||||
base_customer_main main
|
||||
LEFT JOIN base_customer_item item ON main.id = item.cus_id AND item.deleted = 0
|
||||
LEFT JOIN dl_member_level memberLevel ON main.member_level_id = memberLevel.id
|
||||
LEFT JOIN dl_member_level memberLevel ON main.member_level_id = memberLevel.id
|
||||
<where>
|
||||
main.deleted = 0
|
||||
<if test="entity.cusName != null and entity.cusName != ''">
|
||||
@ -84,4 +84,41 @@
|
||||
and main.type_code = '04'
|
||||
ORDER BY main.create_time DESC
|
||||
</select>
|
||||
<select id="queryById" resultType="cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO">
|
||||
SELECT
|
||||
main.id AS id,
|
||||
main.user_id AS userId,
|
||||
main.type_code AS typeCode,
|
||||
main.dept_code AS deptCode,
|
||||
main.cus_name AS cusName,
|
||||
main.phone_number AS phoneNumber,
|
||||
main.birthday AS birthday,
|
||||
main.address AS address,
|
||||
main.sex AS sex,
|
||||
main.id_card AS idCard,
|
||||
main.id_card_image AS idCardImage,
|
||||
main.data_from AS dataFrom,
|
||||
main.near_do_time AS nearDoTime,
|
||||
main.near_do_content AS nearDoContent,
|
||||
main.inviter AS inviter,
|
||||
main.inviter_type AS inviterType,
|
||||
main.STATUS AS STATUS,
|
||||
group_concat( item.ser_content ) AS serContents,
|
||||
memberLevel.NAME AS levelName,
|
||||
COALESCE(bcb.balance, 0.00) AS balance,
|
||||
COALESCE(bcb.forze_balance, 0.00) AS forzeBalance,
|
||||
COALESCE(bcb.all_balance, 0.00) AS allBalance
|
||||
FROM
|
||||
base_customer_main main
|
||||
LEFT JOIN base_customer_item item ON main.id = item.cus_id
|
||||
AND item.deleted = 0
|
||||
LEFT JOIN dl_member_level memberLevel ON main.member_level_id = memberLevel.id
|
||||
AND memberLevel.deleted = 0
|
||||
LEFT JOIN base_customer_balance bcb ON main.id = bcb.cus_id AND bcb.deleted = 0
|
||||
where
|
||||
main.deleted = 0
|
||||
and main.id = #{id}
|
||||
GROUP BY
|
||||
main.id
|
||||
</select>
|
||||
</mapper>
|
||||
@ -16,6 +16,10 @@
|
||||
dl_active_main dam
|
||||
<where>
|
||||
dam.deleted = 0
|
||||
<if test="entity.isNow != null and entity.isNow == 1">
|
||||
AND begin_time <= NOW()
|
||||
AND end_time >= NOW()
|
||||
</if>
|
||||
<if test="entity.name != null and entity.name != ''">
|
||||
and dam.name like concat('%', #{entity.name}, '%')
|
||||
</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user