修改接口

master
吴顺杰 10 months ago
parent 8a034b5238
commit 334e4a2687

@ -10,7 +10,6 @@ import com.ruoyi.system.domain.BNet;
import com.ruoyi.system.service.IBNetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@ -78,8 +77,11 @@ public class BNetController extends BaseController {
/**
*
*
* @param id id
* @return
*/
// @PreAuthorize("@ss.hasPermi('netEwm:net:query')")
@ApiOperation(value = "根据wifi id查询wifi(提供二维码接口)", response = BNet.class)
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bNetService.selectBNetById(id));

@ -2,6 +2,8 @@ package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* b_net_history
@ -9,6 +11,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2023-11-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BNetHistory extends BaseEntity {
private static final long serialVersionUID = 1L;
@ -22,6 +26,36 @@ public class BNetHistory extends BaseEntity {
*/
private Long shanghuId;
/**
*
*/
@Excel(name = "商户名称")
private String posName;
/**
*
*/
@Excel(name = "手机号")
private String phoneNumber;
/**
*
*/
@Excel(name = "联系人")
private String linkMan;
/**
*
*/
@Excel(name = "城市")
private String city;
/**
*
*/
@Excel(name = "地址信息")
private String address;
/**
*
*/
@ -51,79 +85,4 @@ public class BNetHistory extends BaseEntity {
*/
@Excel(name = "wifi密码")
private String wifiPass;
public BNetHistory() {
}
public BNetHistory(Long id, Long shanghuId, Long isTrue, Long netId, String netName, String wifiName, String wifiPass) {
this.id = id;
this.shanghuId = shanghuId;
this.isTrue = isTrue;
this.netId = netId;
this.netName = netName;
this.wifiName = wifiName;
this.wifiPass = wifiPass;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getIsTrue() {
return isTrue;
}
public void setIsTrue(Long isTrue) {
this.isTrue = isTrue;
}
public Long getNetId() {
return netId;
}
public void setNetId(Long netId) {
this.netId = netId;
}
public String getNetName() {
return netName;
}
public void setNetName(String netName) {
this.netName = netName;
}
public String getWifiName() {
return wifiName;
}
public void setWifiName(String wifiName) {
this.wifiName = wifiName;
}
public String getWifiPass() {
return wifiPass;
}
public void setWifiPass(String wifiPass) {
this.wifiPass = wifiPass;
}
@Override
public String toString() {
return "BNetHistory{" + "id=" + id + ", shanghuId=" + shanghuId + ", isTrue=" + isTrue + ", netId=" + netId + ", netName='" + netName + '\'' + ", wifiName='" + wifiName + '\'' + ", wifiPass='" + wifiPass + '\'' + '}';
}
public Long getShanghuId() {
return shanghuId;
}
public void setShanghuId(Long shanghuId) {
this.shanghuId = shanghuId;
}
}

@ -57,6 +57,12 @@ public class BPoster extends BaseEntity {
@Excel(name = "视频路径")
private String videoPath;
/**
*
*/
@Excel(name = "视频时长")
private Double duration;
/**
* 广id
*/

@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@ -12,6 +14,8 @@ import java.util.Date;
* @author ruoyi
* @date 2023-11-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BPosterHistory extends BaseEntity {
private static final long serialVersionUID = 1L;
@ -25,6 +29,36 @@ public class BPosterHistory extends BaseEntity {
*/
private Long shanghuId;
/**
*
*/
@Excel(name = "商户名称")
private String posName;
/**
*
*/
@Excel(name = "手机号")
private String phoneNumber;
/**
*
*/
@Excel(name = "联系人")
private String linkMan;
/**
*
*/
@Excel(name = "城市")
private String city;
/**
*
*/
@Excel(name = "地址信息")
private String address;
/**
* 广id
*/
@ -62,87 +96,4 @@ public class BPosterHistory extends BaseEntity {
*/
@Excel(name = "视频封面")
private String videoLogo;
public BPosterHistory() {
}
public BPosterHistory(Long id, Long shanghuId, Long posterId, String posterName, Date startTime, Date endTime, String videoPath, String videoLogo) {
this.id = id;
this.shanghuId = shanghuId;
this.posterId = posterId;
this.posterName = posterName;
this.startTime = startTime;
this.endTime = endTime;
this.videoPath = videoPath;
this.videoLogo = videoLogo;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPosterId() {
return posterId;
}
public void setPosterId(Long posterId) {
this.posterId = posterId;
}
public String getPosterName() {
return posterName;
}
public void setPosterName(String posterName) {
this.posterName = posterName;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getVideoPath() {
return videoPath;
}
public void setVideoPath(String videoPath) {
this.videoPath = videoPath;
}
public String getVideoLogo() {
return videoLogo;
}
public void setVideoLogo(String videoLogo) {
this.videoLogo = videoLogo;
}
@Override
public String toString() {
return "BPosterHistory{" + "id=" + id + ", shanghuId=" + shanghuId + ", posterId=" + posterId + ", posterName='" + posterName + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", videoPath='" + videoPath + '\'' + ", videoLogo='" + videoLogo + '\'' + '}';
}
public Long getShanghuId() {
return shanghuId;
}
public void setShanghuId(Long shanghuId) {
this.shanghuId = shanghuId;
}
}

@ -41,7 +41,7 @@ public class WeChatCodeRequest implements Serializable {
/**
* id
*/
@ApiModelProperty(value = "商户id", required = true)
@NotNull(message = "商户id不能为空")
private Long shanghuId;
@ApiModelProperty(value = "wifi id", required = true)
@NotNull(message = "wifi id不能为空")
private Long posterId;
}

@ -73,6 +73,6 @@ public interface BNetMapper {
* @param shanghuId id
* @return wifi
*/
BNet findByShanghuId(@Param("shanghuId") Long shanghuId);
List<BNet> findByShanghuId(@Param("shanghuId") Long shanghuId);
}

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.Poster;
/**
* 广Mapper
@ -58,4 +59,13 @@ public interface BPosterMapper
* @return
*/
public int deleteBPosterByIds(Long[] ids);
/**
* 广
*
* @return 广
*/
Poster findByOne();
}

@ -72,5 +72,5 @@ public interface IBNetService {
* @param id id
* @return wifi
*/
BNet findById(Long id);
List<BNet> findById(Long id);
}

@ -1,6 +1,7 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.Poster;
import com.ruoyi.system.domain.dto.request.PosterRequest;
import java.util.List;
@ -66,4 +67,12 @@ public interface IBPosterService {
* @param req
*/
void batchAllocation(PosterRequest req);
/**
* 广
*
* @return 广
*/
Poster findByOne();
}

@ -56,10 +56,6 @@ public class BNetServiceImpl implements IBNetService {
if (bNet.getShanghuId() == null) {
throw new ServiceException("商户id不能为空");
}
BNet net = bNetMapper.findByShanghuId(bNet.getShanghuId());
if (BeanUtil.isNotEmpty(net)) {
throw new ServiceException("已经存在wifi网络不能新增");
}
bNet.setCreateTime(DateUtils.getNowDate());
return bNetMapper.insertBNet(bNet);
}
@ -115,7 +111,7 @@ public class BNetServiceImpl implements IBNetService {
* @return wifi
*/
@Override
public BNet findById(Long id) {
public List<BNet> findById(Long id) {
return bNetMapper.findByShanghuId(id);
}
}

@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.Poster;
import com.ruoyi.system.domain.dto.request.PosterRequest;
import com.ruoyi.system.mapper.BPosterMapper;
import com.ruoyi.system.service.IBPosterService;
@ -131,4 +132,14 @@ public class BPosterServiceImpl implements IBPosterService {
throw new ServiceException("参数错误");
}
/**
* 广
*
* @return 广
*/
@Override
public Poster findByOne() {
return bPosterMapper.findByOne();
}
}

@ -7,6 +7,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.BShanghu;
import com.ruoyi.system.domain.Poster;
import com.ruoyi.system.mapper.BShanghuMapper;
import com.ruoyi.system.service.IBNetService;
import com.ruoyi.system.service.IBPosterService;
@ -69,6 +70,9 @@ public class BShanghuServiceImpl implements IBShanghuService {
@Override
public int insertBShanghu(BShanghu bShanghu) {
bShanghu.setCreateTime(DateUtils.getNowDate());
// 填充广告id
Poster poster = posterService.findByOne();
bShanghu.setPosterId(poster.getId());
SysUser user = new SysUser();
user.setUserName(bShanghu.getPhoneNumber());
user.setPassword(SecurityUtils.encryptPassword("123456"));

@ -154,7 +154,7 @@ public class WeChatServiceImpl implements WeChatService {
if (req.getWidth() != null) {
map.put("width", req.getWidth());
}
map.put("path", req.getPath() + "?shanghuId=" + req.getShanghuId());
map.put("path", req.getPath() + "?posterId=" + req.getPosterId());
String jsonStr = JSONUtil.toJsonStr(map);
return HttpRequest.post("https://api.weixin.qq.com/wxa/getwxacode?access_token=" + accessToken)
.body(jsonStr)

@ -17,36 +17,54 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="posName" column="pos_name"/>
<result property="phoneNumber" column="phone_number"/>
<result property="linkMan" column="link_man"/>
<result property="city" column="city"/>
<result property="address" column="address"/>
</resultMap>
<sql id="selectBNetHistoryVo">
select id,
is_true,
shanghu_id,
net_id,
net_name,
wifi_name,
wifi_pass,
create_by,
create_time,
update_by,
update_time,
remark
from b_net_history
select bnh.id,
bnh.is_true,
bnh.shanghu_id,
bnh.net_id,
bnh.net_name,
bnh.wifi_name,
bnh.wifi_pass,
bnh.create_by,
bnh.create_time,
bnh.update_by,
bnh.update_time,
bnh.remark,
bs.pos_name,
bs.phone_number,
bs.link_man,
bs.city,
bs.address
from b_net_history bnh
left join b_shanghu bs on bnh.shanghu_id = bs.id
</sql>
<select id="selectBNetHistoryList" parameterType="BNetHistory" resultMap="BNetHistoryResult">
<include refid="selectBNetHistoryVo"/>
<where>
<if test="isTrue != null ">and is_true = #{isTrue}</if>
<if test="shanghuId != null ">and shanghu_id = #{shanghuId}</if>
<if test="netName != null and netName != ''">and net_name like concat('%', #{netName}, '%')</if>
<if test="isTrue != null ">and bnh.is_true = #{isTrue}</if>
<if test="shanghuId != null ">and bnh.shanghu_id = #{shanghuId}</if>
<if test="netName != null and netName != ''">and bnh.net_name like concat('%', #{netName}, '%')</if>
<if test="posName != null and posName != ''">and bs.pos_name like concat('%', #{posName}, '%')</if>
<if test="phoneNumber != null and phoneNumber != ''">and bs.phone_number like concat('%', #{phoneNumber},
'%')
</if>
<if test="linkMan != null and linkMan != ''">and bs.link_man like concat('%', #{linkMan}, '%')</if>
<if test="city != null and city != ''">and bs.city like concat('%', #{city}, '%')</if>
<if test="address != null and address != ''">and bs.address like concat('%', #{address}, '%')</if>
</where>
</select>
<select id="selectBNetHistoryById" parameterType="Long" resultMap="BNetHistoryResult">
<include refid="selectBNetHistoryVo"/>
where id = #{id}
where bnh.id = #{id}
</select>
<insert id="insertBNetHistory" parameterType="com.ruoyi.system.domain.BNetHistory" useGeneratedKeys="true"

@ -37,7 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select *
from b_net
where shanghu_id = #{shanghuId}
limit 1
</select>
<insert id="insertBNet" parameterType="BNet" useGeneratedKeys="true" keyProperty="id">

@ -18,39 +18,52 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="posName" column="pos_name"/>
<result property="phoneNumber" column="phone_number"/>
<result property="linkMan" column="link_man"/>
<result property="city" column="city"/>
<result property="address" column="address"/>
</resultMap>
<sql id="selectBPosterHistoryVo">
select id,
poster_id,
shanghu_id,
poster_name,
start_time,
end_time,
video_path,
video_logo,
create_by,
create_time,
update_by,
update_time,
remark
from b_poster_history
select bph.id,
bph.poster_id,
bph.shanghu_id,
bph.poster_name,
bph.start_time,
bph.end_time,
bph.video_path,
bph.video_logo,
bph.create_by,
bph.create_time,
bph.update_by,
bph.update_time,
bph.remark
from b_poster_history bph
left join b_shanghu bs on bph.shanghu_id = bs.id
</sql>
<select id="selectBPosterHistoryList" parameterType="BPosterHistory" resultMap="BPosterHistoryResult">
<include refid="selectBPosterHistoryVo"/>
<where>
<if test="posterName != null and posterName != ''">and poster_name like concat('%', #{posterName}, '%')
<if test="posterName != null and posterName != ''">and bph.poster_name like concat('%', #{posterName}, '%')
</if>
<if test="startTime != null ">and bph.start_time = #{startTime}</if>
<if test="shanghuId != null ">and bph.shanghu_id = #{shanghuId}</if>
<if test="endTime != null ">and bph.end_time = #{endTime}</if>
<if test="posName != null and posName != ''">and bs.pos_name like concat('%', #{posName}, '%')</if>
<if test="phoneNumber != null and phoneNumber != ''">and bs.phone_number like concat('%', #{phoneNumber},
'%')
</if>
<if test="startTime != null ">and start_time = #{startTime}</if>
<if test="shanghuId != null ">and shanghu_id = #{shanghuId}</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
<if test="linkMan != null and linkMan != ''">and bs.link_man like concat('%', #{linkMan}, '%')</if>
<if test="city != null and city != ''">and bs.city like concat('%', #{city}, '%')</if>
<if test="address != null and address != ''">and bs.address like concat('%', #{address}, '%')</if>
</where>
</select>
<select id="selectBPosterHistoryById" parameterType="Long" resultMap="BPosterHistoryResult">
<include refid="selectBPosterHistoryVo"/>
where id = #{id}
where bph.id = #{id}
</select>
<insert id="insertBPosterHistory" parameterType="BPosterHistory" useGeneratedKeys="true" keyProperty="id">

@ -1,33 +1,47 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BPosterMapper">
<resultMap type="BPoster" id="BPosterResult">
<result property="id" column="id" />
<result property="posterName" column="poster_name" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="videoLogo" column="video_logo" />
<result property="videoPath" column="video_path" />
<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" />
<result property="id" column="id"/>
<result property="posterName" column="poster_name"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="videoLogo" column="video_logo"/>
<result property="videoPath" column="video_path"/>
<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"/>
<result property="duration" column="duration"/>
</resultMap>
<sql id="selectBPosterVo">
select id, poster_name, start_time, end_time, video_logo, video_path, create_by, create_time, update_by, update_time, remark from b_poster
select id,
poster_name,
duration,
start_time,
end_time,
video_logo,
video_path,
create_by,
create_time,
update_by,
update_time,
remark
from b_poster
</sql>
<select id="selectBPosterList" parameterType="BPoster" resultMap="BPosterResult">
<include refid="selectBPosterVo"/>
<where>
<if test="posterName != null and posterName != ''"> and poster_name like concat('%', #{posterName}, '%')</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="posterName != null and posterName != ''">and poster_name like concat('%', #{posterName}, '%')
</if>
<if test="startTime != null ">and start_time = #{startTime}</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
</where>
</select>
@ -36,6 +50,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="findByOne" resultType="com.ruoyi.system.domain.Poster">
select id,
poster_name,
duration,
start_time,
end_time,
video_logo,
video_path,
create_by,
create_time,
update_by,
update_time,
remark
from b_poster
order by id desc
limit 1
</select>
<insert id="insertBPoster" parameterType="BPoster" useGeneratedKeys="true" keyProperty="id">
insert into b_poster
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -49,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="duration != null">duration,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="posterName != null">#{posterName},</if>
@ -61,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="duration != null">#{duration},</if>
</trim>
</insert>
@ -77,12 +111,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="duration != null">remark = #{duration},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBPosterById" parameterType="Long">
delete from b_poster where id = #{id}
delete
from b_poster
where id = #{id}
</delete>
<delete id="deleteBPosterByIds" parameterType="String">
@ -91,4 +128,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>

@ -1,118 +1,117 @@
package com.ruoyi.common.core.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Entity
*
* @author ruoyi
*/
public class BaseEntity implements Serializable
{
public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/** 搜索值 */
/**
*
*/
@JsonIgnore
private String searchValue;
/** 创建者 */
/**
*
*/
private String createBy;
/** 创建时间 */
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新者 */
/**
*
*/
private String updateBy;
/** 更新时间 */
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 备注 */
/**
*
*/
private String remark;
/** 请求参数 */
/**
*
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params;
public String getSearchValue()
{
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue)
{
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getCreateBy()
{
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy)
{
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime()
{
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime)
{
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy()
{
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy)
{
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime()
{
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime)
{
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark()
{
public String getRemark() {
return remark;
}
public void setRemark(String remark)
{
public void setRemark(String remark) {
this.remark = remark;
}
public Map<String, Object> getParams()
{
if (params == null)
{
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params)
{
public void setParams(Map<String, Object> params) {
this.params = params;
}
}

@ -13,7 +13,9 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.system.domain.Poster;
import com.ruoyi.system.domain.SysShanghu;
import com.ruoyi.system.mapper.SysPosterMapper;
import com.ruoyi.system.mapper.SysShanghuMapper;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
@ -42,6 +44,9 @@ public class SysRegisterService {
@Resource
private SysShanghuMapper shanghuMapper;
@Resource
private SysPosterMapper posterMapper;
/**
*
*/
@ -87,6 +92,9 @@ public class SysRegisterService {
shangHu.setPhoneNumber(sysUser.getUserName());
shangHu.setLinkMan(sysUser.getNickName());
shangHu.setCreateTime(new Date());
// 填充广告id
Poster poster = posterMapper.findByOne();
shangHu.setPosterId(poster.getId());
shanghuMapper.insertBShanghu(shangHu);
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success")));
}

@ -0,0 +1,107 @@
package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 广 b_poster
*
* @author ruoyi
* @date 2023-11-21
*/
public class Poster extends BaseEntity {
private static final long serialVersionUID = 5298961068999599481L;
/**
* $column.columnComment
*/
private Long id;
/**
* 广
*/
@Excel(name = "广告名称")
private String posterName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效起始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/**
*
*/
@Excel(name = "视频封面")
private String videoLogo;
/**
*
*/
@Excel(name = "视频路径")
private String videoPath;
@Override
public String toString() {
return "Poster{" + "id=" + id + ", posterName='" + posterName + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", videoLogo='" + videoLogo + '\'' + ", videoPath='" + videoPath + '\'' + '}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPosterName() {
return posterName;
}
public void setPosterName(String posterName) {
this.posterName = posterName;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getVideoLogo() {
return videoLogo;
}
public void setVideoLogo(String videoLogo) {
this.videoLogo = videoLogo;
}
public String getVideoPath() {
return videoPath;
}
public void setVideoPath(String videoPath) {
this.videoPath = videoPath;
}
}

@ -0,0 +1,20 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.Poster;
/**
* 广Mapper
*
* @author ruoyi
* @date 2023-11-21
*/
public interface SysPosterMapper {
/**
* 广
*
* @return 广
*/
Poster findByOne();
}

@ -0,0 +1,39 @@
<?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.ruoyi.system.mapper.SysPosterMapper">
<resultMap type="Poster" id="BPosterResult">
<result property="id" column="id"/>
<result property="posterName" column="poster_name"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="videoLogo" column="video_logo"/>
<result property="videoPath" column="video_path"/>
<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>
<select id="findByOne" resultType="com.ruoyi.system.domain.Poster">
select id,
poster_name,
start_time,
end_time,
video_logo,
video_path,
create_by,
create_time,
update_by,
update_time,
remark
from b_poster
order by id desc
limit 1
</select>
</mapper>
Loading…
Cancel
Save