add 会议随机码基础代码

This commit is contained in:
lijiarao
2022-06-21 11:24:03 +08:00
parent dc690b2afa
commit b0f92a620b
10 changed files with 389 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
create table pay_random_code
(
random_code_id varchar(36) not null comment 'id',
create_by varchar(50) null comment '创建人',
create_time datetime null comment '创建日期',
update_by varchar(50) null comment '更新人',
update_time datetime null comment '更新日期',
meeting_id varchar(50) null comment '会议id',
guest_type tinyint(1) null comment '嘉宾类型',
random_code_count int null comment '随机码个数',
use_count int default 0 comment '使用个数'
) comment '随机码表';
create table pay_random_code_link
(
id varchar(36) not null comment 'id',
random_code_id varchar(36) not null comment 'random_code_id',
random_code varchar(6) null comment '随机码',
use_flag tinyint(1) default 0 comment '是否使用'
) comment '随机码关联表';
@@ -0,0 +1,115 @@
package com.jero.meeting.controller;
import com.jero.meeting.entity.PayRandomCode;
import com.jero.meeting.entity.PayRandomCodeLink;
import com.jero.meeting.service.PayRandomCodeLinkService;
import com.jero.meeting.service.PayRandomCodeService;
import java.util.Collections;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
/**
* (pay_random_code)表控制层
*
* @author xxxxx
*/
@Slf4j
@Api(tags="随机码表")
@RestController
@RequestMapping("/meeting/randomCode")
public class PayRandomCodeController extends JeroController<PayRandomCode, PayRandomCodeService>{
/**
* 服务对象
*/
@Resource
private PayRandomCodeService payRandomCodeService;
@Resource
private PayRandomCodeLinkService payRandomCodeLinkService;
/**
* 分页列表查询
*/
@RequiresPermissions("internationalSeminarGenerateCode:search")
@ApiOperation(value="随机码表-分页列表查询", notes="随机码表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(PayRandomCode randomCode,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PayRandomCode> queryWrapper = QueryGenerator.initQueryWrapper(randomCode, req.getParameterMap());
Page<PayRandomCode> page = new Page<>(pageNo, pageSize);
IPage<PayRandomCode> pageList = payRandomCodeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 分页列表查询
*/
@RequiresPermissions("internationalSeminarGenerateCode:search")
@ApiOperation(value="随机码关联表-分页列表查询", notes="随机码关联表-分页列表查询")
@GetMapping(value = "/link/page")
public Result<?> queryPageList(PayRandomCodeLink randomCodeLink,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PayRandomCodeLink> queryWrapper = QueryGenerator.initQueryWrapper(randomCodeLink, req.getParameterMap());
Page<PayRandomCodeLink> page = new Page<>(pageNo, pageSize);
IPage<PayRandomCodeLink> pageList = payRandomCodeLinkService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*/
@RequiresPermissions("internationalSeminarGenerateCode:add")
@AutoLog(value = "随机码表-添加")
@ApiOperation(value="随机码表-添加", notes="随机码表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody PayRandomCode randomCode) {
payRandomCodeService.add(randomCode);
return Result.OK("添加成功!");
}
/**
* 编辑
*/
@RequiresPermissions("internationalSeminarGenerateCode:edit")
@AutoLog(value = "随机码表-编辑")
@ApiOperation(value="随机码表-编辑", notes="随机码表-编辑")
@PostMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody PayRandomCode randomCode) {
payRandomCodeService.editById(randomCode);
return Result.OK("编辑成功!");
}
/**
* 导出excel
*/
@RequiresPermissions("internationalSeminarGenerateCode:export")
@ApiOperation(value="随机码表-导出excel")
@GetMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PayRandomCode randomCode) {
return super.exportXls(request, randomCode, PayRandomCode.class, "");
}
}
@@ -0,0 +1,98 @@
package com.jero.meeting.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
/**
*
*@author liJiaRao
*@date 2022-06-21 10:20
*/
/**
* 随机码表
*/
@ApiModel(value="随机码表")
@Data
@TableName(value = "pay_random_code")
public class PayRandomCode {
/**
* id
*/
@TableField(value = "random_code_id")
@ApiModelProperty(value="id")
private String randomCodeId;
/**
* 创建人
*/
@TableField(value = "create_by")
@ApiModelProperty(value="创建人")
private String createBy;
/**
* 创建日期
*/
@TableField(value = "create_time")
@ApiModelProperty(value="创建日期")
private Date createTime;
/**
* 更新人
*/
@TableField(value = "update_by")
@ApiModelProperty(value="更新人")
private String updateBy;
/**
* 更新日期
*/
@TableField(value = "update_time")
@ApiModelProperty(value="更新日期")
private Date updateTime;
/**
* 会议id
*/
@TableField(value = "meeting_id")
@ApiModelProperty(value="会议id")
private Integer meeting_id;
/**
* 嘉宾类型
*/
@TableField(value = "guest_type")
@Excel(name = "嘉宾类型", width = 15,dicCode = "guest_type")
@ApiModelProperty(value="嘉宾类型")
@Dict(dicCode = "guest_type")
private Integer guestType;
/**
* 随机码个数
*/
@TableField(value = "random_code_count")
@Excel(name = "随机码个数", width = 15)
@ApiModelProperty(value="随机码个数")
private Integer randomCodeCount;
/**
* 使用个数
*/
@TableField(value = "use_count")
@Excel(name = "使用个数", width = 15)
@ApiModelProperty(value="使用个数")
private Integer useCount;
@ExcelCollection(name = "随机码")
private List<PayRandomCodeLink> randomCodeLinkList;
}
@@ -0,0 +1,55 @@
package com.jero.meeting.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
*
*@author liJiaRao
*@date 2022-06-21 10:20
*/
/**
* 随机码关联表
*/
@ApiModel(value="随机码关联表")
@Data
@TableName(value = "pay_random_code_link")
public class PayRandomCodeLink {
/**
* id
*/
@TableField(value = "id")
@ApiModelProperty(value="id")
private String id;
/**
* random_code_id
*/
@TableField(value = "random_code_id")
@ApiModelProperty(value="random_code_id")
private String randomCodeId;
/**
* 随机码
*/
@TableField(value = "random_code")
@Excel(name = "随机码", width = 15)
@ApiModelProperty(value="随机码")
private Integer randomCode;
/**
* 是否使用
*/
@TableField(value = "use_flag")
@Excel(name = "使用个数", width = 15, dicCode = "yn")
@Dict(dicCode = "yn")
@ApiModelProperty(value="是否使用")
private Integer useFlag;
}
@@ -0,0 +1,12 @@
package com.jero.meeting.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.meeting.entity.PayRandomCodeLink;
/**
*
*@author liJiaRao
*@date 2022-06-21 10:20
*/
public interface PayRandomCodeLinkMapper extends BaseMapper<PayRandomCodeLink> {
}
@@ -0,0 +1,12 @@
package com.jero.meeting.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.meeting.entity.PayRandomCode;
/**
*
*@author liJiaRao
*@date 2022-06-21 10:20
*/
public interface PayRandomCodeMapper extends BaseMapper<PayRandomCode> {
}
@@ -0,0 +1,16 @@
<?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="com.jero.meeting.mapper.PayRandomCodeLinkMapper">
<resultMap id="BaseResultMap" type="com.jero.meeting.entity.PayRandomCodeLink">
<!--@mbg.generated-->
<!--@Table pay_random_code_link-->
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="random_code_id" jdbcType="VARCHAR" property="randomCodeId" />
<result column="random_code" jdbcType="BOOLEAN" property="randomCode" />
<result column="use_flag" jdbcType="BOOLEAN" property="useFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, random_code_id, random_code, use_flag
</sql>
</mapper>
@@ -0,0 +1,21 @@
<?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="com.jero.meeting.mapper.PayRandomCodeMapper">
<resultMap id="BaseResultMap" type="com.jero.meeting.entity.PayRandomCode">
<!--@mbg.generated-->
<!--@Table pay_random_code-->
<result column="random_code_id" jdbcType="VARCHAR" property="randomCodeId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="guest_type" jdbcType="BOOLEAN" property="guestType" />
<result column="random_code_count" jdbcType="INTEGER" property="randomCodeCount" />
<result column="use_count" jdbcType="BOOLEAN" property="useCount" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
random_code_id, create_by, create_time, update_by, update_time, guest_type, random_code_count,
use_count
</sql>
</mapper>
@@ -0,0 +1,17 @@
package com.jero.meeting.service;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.meeting.entity.PayRandomCodeLink;
import com.jero.meeting.mapper.PayRandomCodeLinkMapper;
/**
*
*@author liJiaRao
*@date 2022-06-21 10:20
*/
@Service
public class PayRandomCodeLinkService extends ServiceImpl<PayRandomCodeLinkMapper, PayRandomCodeLink> {
}
@@ -0,0 +1,23 @@
package com.jero.meeting.service;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.meeting.mapper.PayRandomCodeMapper;
import com.jero.meeting.entity.PayRandomCode;
/**
*
*@author liJiaRao
*@date 2022-06-21 10:20
*/
@Service
public class PayRandomCodeService extends ServiceImpl<PayRandomCodeMapper, PayRandomCode> {
public void editById(PayRandomCode randomCode) {
}
public void add(PayRandomCode randomCode) {
}
}