修改接口

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 com.ruoyi.system.service.IBNetService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; 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}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bNetService.selectBNetById(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.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/** /**
* b_net_history * b_net_history
@ -9,6 +11,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
@Data
@EqualsAndHashCode(callSuper = true)
public class BNetHistory extends BaseEntity { public class BNetHistory extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -22,6 +26,36 @@ public class BNetHistory extends BaseEntity {
*/ */
private Long shanghuId; 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密码") @Excel(name = "wifi密码")
private String wifiPass; 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 = "视频路径") @Excel(name = "视频路径")
private String videoPath; private String videoPath;
/**
*
*/
@Excel(name = "视频时长")
private Double duration;
/** /**
* 广id * 广id
*/ */

@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
@ -12,6 +14,8 @@ import java.util.Date;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
@Data
@EqualsAndHashCode(callSuper = true)
public class BPosterHistory extends BaseEntity { public class BPosterHistory extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -25,6 +29,36 @@ public class BPosterHistory extends BaseEntity {
*/ */
private Long shanghuId; 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 * 广id
*/ */
@ -62,87 +96,4 @@ public class BPosterHistory extends BaseEntity {
*/ */
@Excel(name = "视频封面") @Excel(name = "视频封面")
private String videoLogo; 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 * id
*/ */
@ApiModelProperty(value = "商户id", required = true) @ApiModelProperty(value = "wifi id", required = true)
@NotNull(message = "商户id不能为空") @NotNull(message = "wifi id不能为空")
private Long shanghuId; private Long posterId;
} }

@ -73,6 +73,6 @@ public interface BNetMapper {
* @param shanghuId id * @param shanghuId id
* @return wifi * @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 java.util.List;
import com.ruoyi.system.domain.BPoster; import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.Poster;
/** /**
* 广Mapper * 广Mapper
@ -58,4 +59,13 @@ public interface BPosterMapper
* @return * @return
*/ */
public int deleteBPosterByIds(Long[] ids); public int deleteBPosterByIds(Long[] ids);
/**
* 广
*
* @return 广
*/
Poster findByOne();
} }

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

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

@ -56,10 +56,6 @@ public class BNetServiceImpl implements IBNetService {
if (bNet.getShanghuId() == null) { if (bNet.getShanghuId() == null) {
throw new ServiceException("商户id不能为空"); throw new ServiceException("商户id不能为空");
} }
BNet net = bNetMapper.findByShanghuId(bNet.getShanghuId());
if (BeanUtil.isNotEmpty(net)) {
throw new ServiceException("已经存在wifi网络不能新增");
}
bNet.setCreateTime(DateUtils.getNowDate()); bNet.setCreateTime(DateUtils.getNowDate());
return bNetMapper.insertBNet(bNet); return bNetMapper.insertBNet(bNet);
} }
@ -115,7 +111,7 @@ public class BNetServiceImpl implements IBNetService {
* @return wifi * @return wifi
*/ */
@Override @Override
public BNet findById(Long id) { public List<BNet> findById(Long id) {
return bNetMapper.findByShanghuId(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.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.BPoster; import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.Poster;
import com.ruoyi.system.domain.dto.request.PosterRequest; import com.ruoyi.system.domain.dto.request.PosterRequest;
import com.ruoyi.system.mapper.BPosterMapper; import com.ruoyi.system.mapper.BPosterMapper;
import com.ruoyi.system.service.IBPosterService; import com.ruoyi.system.service.IBPosterService;
@ -131,4 +132,14 @@ public class BPosterServiceImpl implements IBPosterService {
throw new ServiceException("参数错误"); 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.common.utils.SecurityUtils;
import com.ruoyi.system.domain.BPoster; import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.BShanghu; import com.ruoyi.system.domain.BShanghu;
import com.ruoyi.system.domain.Poster;
import com.ruoyi.system.mapper.BShanghuMapper; import com.ruoyi.system.mapper.BShanghuMapper;
import com.ruoyi.system.service.IBNetService; import com.ruoyi.system.service.IBNetService;
import com.ruoyi.system.service.IBPosterService; import com.ruoyi.system.service.IBPosterService;
@ -69,6 +70,9 @@ public class BShanghuServiceImpl implements IBShanghuService {
@Override @Override
public int insertBShanghu(BShanghu bShanghu) { public int insertBShanghu(BShanghu bShanghu) {
bShanghu.setCreateTime(DateUtils.getNowDate()); bShanghu.setCreateTime(DateUtils.getNowDate());
// 填充广告id
Poster poster = posterService.findByOne();
bShanghu.setPosterId(poster.getId());
SysUser user = new SysUser(); SysUser user = new SysUser();
user.setUserName(bShanghu.getPhoneNumber()); user.setUserName(bShanghu.getPhoneNumber());
user.setPassword(SecurityUtils.encryptPassword("123456")); user.setPassword(SecurityUtils.encryptPassword("123456"));

@ -154,7 +154,7 @@ public class WeChatServiceImpl implements WeChatService {
if (req.getWidth() != null) { if (req.getWidth() != null) {
map.put("width", req.getWidth()); 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); String jsonStr = JSONUtil.toJsonStr(map);
return HttpRequest.post("https://api.weixin.qq.com/wxa/getwxacode?access_token=" + accessToken) return HttpRequest.post("https://api.weixin.qq.com/wxa/getwxacode?access_token=" + accessToken)
.body(jsonStr) .body(jsonStr)

@ -17,36 +17,54 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/> <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> </resultMap>
<sql id="selectBNetHistoryVo"> <sql id="selectBNetHistoryVo">
select id, select bnh.id,
is_true, bnh.is_true,
shanghu_id, bnh.shanghu_id,
net_id, bnh.net_id,
net_name, bnh.net_name,
wifi_name, bnh.wifi_name,
wifi_pass, bnh.wifi_pass,
create_by, bnh.create_by,
create_time, bnh.create_time,
update_by, bnh.update_by,
update_time, bnh.update_time,
remark bnh.remark,
from b_net_history 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> </sql>
<select id="selectBNetHistoryList" parameterType="BNetHistory" resultMap="BNetHistoryResult"> <select id="selectBNetHistoryList" parameterType="BNetHistory" resultMap="BNetHistoryResult">
<include refid="selectBNetHistoryVo"/> <include refid="selectBNetHistoryVo"/>
<where> <where>
<if test="isTrue != null ">and is_true = #{isTrue}</if> <if test="isTrue != null ">and bnh.is_true = #{isTrue}</if>
<if test="shanghuId != null ">and shanghu_id = #{shanghuId}</if> <if test="shanghuId != null ">and bnh.shanghu_id = #{shanghuId}</if>
<if test="netName != null and netName != ''">and net_name like concat('%', #{netName}, '%')</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> </where>
</select> </select>
<select id="selectBNetHistoryById" parameterType="Long" resultMap="BNetHistoryResult"> <select id="selectBNetHistoryById" parameterType="Long" resultMap="BNetHistoryResult">
<include refid="selectBNetHistoryVo"/> <include refid="selectBNetHistoryVo"/>
where id = #{id} where bnh.id = #{id}
</select> </select>
<insert id="insertBNetHistory" parameterType="com.ruoyi.system.domain.BNetHistory" useGeneratedKeys="true" <insert id="insertBNetHistory" parameterType="com.ruoyi.system.domain.BNetHistory" useGeneratedKeys="true"

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

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

@ -1,41 +1,73 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BPosterMapper"> <mapper namespace="com.ruoyi.system.mapper.BPosterMapper">
<resultMap type="BPoster" id="BPosterResult"> <resultMap type="BPoster" id="BPosterResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="posterName" column="poster_name" /> <result property="posterName" column="poster_name"/>
<result property="startTime" column="start_time" /> <result property="startTime" column="start_time"/>
<result property="endTime" column="end_time" /> <result property="endTime" column="end_time"/>
<result property="videoLogo" column="video_logo" /> <result property="videoLogo" column="video_logo"/>
<result property="videoPath" column="video_path" /> <result property="videoPath" column="video_path"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="duration" column="duration"/>
</resultMap> </resultMap>
<sql id="selectBPosterVo"> <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> </sql>
<select id="selectBPosterList" parameterType="BPoster" resultMap="BPosterResult"> <select id="selectBPosterList" parameterType="BPoster" resultMap="BPosterResult">
<include refid="selectBPosterVo"/> <include refid="selectBPosterVo"/>
<where> <where>
<if test="posterName != null and posterName != ''"> and poster_name like concat('%', #{posterName}, '%')</if> <if test="posterName != null and posterName != ''">and poster_name like concat('%', #{posterName}, '%')
<if test="startTime != null "> and start_time = #{startTime}</if> </if>
<if test="endTime != null "> and end_time = #{endTime}</if> <if test="startTime != null ">and start_time = #{startTime}</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
</where> </where>
</select> </select>
<select id="selectBPosterById" parameterType="Long" resultMap="BPosterResult"> <select id="selectBPosterById" parameterType="Long" resultMap="BPosterResult">
<include refid="selectBPosterVo"/> <include refid="selectBPosterVo"/>
where id = #{id} where id = #{id}
</select> </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 id="insertBPoster" parameterType="BPoster" useGeneratedKeys="true" keyProperty="id">
insert into b_poster insert into b_poster
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -49,7 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> <if test="duration != null">duration,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="posterName != null">#{posterName},</if> <if test="posterName != null">#{posterName},</if>
<if test="startTime != null">#{startTime},</if> <if test="startTime != null">#{startTime},</if>
@ -61,7 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
</trim> <if test="duration != null">#{duration},</if>
</trim>
</insert> </insert>
<update id="updateBPoster" parameterType="BPoster"> <update id="updateBPoster" parameterType="BPoster">
@ -77,18 +111,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="duration != null">remark = #{duration},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteBPosterById" parameterType="Long"> <delete id="deleteBPosterById" parameterType="Long">
delete from b_poster where id = #{id} delete
from b_poster
where id = #{id}
</delete> </delete>
<delete id="deleteBPosterByIds" parameterType="String"> <delete id="deleteBPosterByIds" parameterType="String">
delete from b_poster where id in delete from b_poster where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>

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

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