通告代码

This commit is contained in:
13405411873 2025-03-21 14:54:15 +08:00
parent 451079ffda
commit 61b994d3ae
9 changed files with 138 additions and 90 deletions

View File

@ -6,6 +6,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.query.BusiNoticeQuery;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -28,7 +29,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
* 通告Controller
*
*
* @author 朱春云
* @date 2025-03-17
*/
@ -44,12 +45,12 @@ public class BusiNoticeController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('busi:notice:list')")
@GetMapping("/list")
public AjaxResult list(BusiNotice busiNotice,
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
public AjaxResult list(BusiNoticeQuery query,
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
{
Page<BusiNotice> page = new Page<>(pageNum, pageSize);
IPage<BusiNotice> list = busiNoticeService.queryListPage(busiNotice,page);
IPage<BusiNotice> list = busiNoticeService.queryListPage(query,page);
return success(list);
}
@ -84,7 +85,8 @@ public class BusiNoticeController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody BusiNotice busiNotice)
{
return toAjax(busiNoticeService.save(busiNotice));
busiNoticeService.saveVo(busiNotice);
return success();
}
/**
@ -109,4 +111,7 @@ public class BusiNoticeController extends BaseController
List<String> list = new ArrayList<>(Arrays.asList(ids));
return toAjax(busiNoticeService.removeByIds(list));
}
}

View File

@ -12,9 +12,9 @@ import com.ruoyi.common.core.domain.DlBaseEntity;
/**
* 通告对象 dl_busi_notice
*
*
* @author 朱春云
* @date 2025-03-17
* @date 2025-03-18
*/
@TableName("dl_busi_notice")
@Data
@ -40,15 +40,14 @@ public class BusiNotice extends DlBaseEntity
private String title;
/** 平台 */
@Excel(name = "平台")
private String platformCode;
/** 平台名称 */
@Excel(name = "平台名称")
private String platformName;
/** 国家 */
@Excel(name = "国家")
private String country;
/** 省份 */
private String province;
/** 城市 */
private String city;
/** 稿费下限 */
@Excel(name = "稿费下限")
@ -99,12 +98,12 @@ public class BusiNotice extends DlBaseEntity
@Excel(name = "报名是否需符合粉丝要求(0否|1是)")
private Integer isEligible;
/** 图文/视频/不限 */
@Excel(name = "图文/视频/不限")
/** 内容形式 */
@Excel(name = "内容形式")
private String pic;
/** 单品/合集/不限 */
@Excel(name = "单品/合集/不限")
/** 展示形式 */
@Excel(name = "展示形式")
private String collect;
/** 通告明细 */

View File

@ -4,18 +4,19 @@ import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.busi.domain.BusiNotice;
import com.ruoyi.query.BusiNoticeQuery;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 通告Mapper接口
*
*
* @author 朱春云
* @date 2025-03-17
*/
@Mapper
public interface BusiNoticeMapper extends BaseMapper<BusiNotice>
{
IPage<BusiNotice> queryListPage(@Param("entity") BusiNotice entity, Page<BusiNotice> page);
IPage<BusiNotice> queryListPage(@Param("entity") BusiNoticeQuery query, Page<BusiNotice> page);
}

View File

@ -5,14 +5,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.busi.domain.BusiNotice;
import com.ruoyi.query.BusiNoticeQuery;
/**
* 通告Service接口
*
*
* @author 朱春云
* @date 2025-03-17
*/
public interface IBusiNoticeService extends IService<BusiNotice>
{
IPage<BusiNotice> queryListPage(BusiNotice pageReqVO, Page<BusiNotice> page);
IPage<BusiNotice> queryListPage(BusiNoticeQuery query, Page<BusiNotice> page);
void saveVo(BusiNotice data);
}

View File

@ -4,6 +4,8 @@ import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.query.BusiNoticeQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -13,7 +15,7 @@ import com.ruoyi.busi.service.IBusiNoticeService;
/**
* 通告Service业务层处理
*
*
* @author 朱春云
* @date 2025-03-17
*/
@ -24,7 +26,14 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
private BusiNoticeMapper busiNoticeMapper;
@Override
public IPage<BusiNotice> queryListPage(BusiNotice pageReqVO, Page<BusiNotice> page) {
return busiNoticeMapper.queryListPage(pageReqVO, page);
public IPage<BusiNotice> queryListPage(BusiNoticeQuery query, Page<BusiNotice> page) {
return busiNoticeMapper.queryListPage(query, page);
}
@Override
public void saveVo(BusiNotice data) {
//获取当前登录用户
data.setUserId(SecurityUtils.getUserId());
this.save(data);
}
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.busi.vo;
import com.ruoyi.busi.domain.BusiNotice;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
@Data
public class BusiNoticeVo extends BusiNotice {
/**发布者名称**/
private String userNickName;
/** 平台名称 */
private String platformName;
}

View File

@ -0,0 +1,37 @@
package com.ruoyi.query;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class BusiNoticeQuery {
/**发布者名称**/
private String userNickName;
/** 标题 */
private String title;
/** 平台 */
private String platformCode;
/** 省份 */
private String province;
/** 城市 */
private String city;
/** 品牌 */
private String brand;
/** 内容形式 */
private String pic;
/** 展示形式 */
private String collect;
/** 是否使用通告券0 否|1是 */
private Integer isUseCoupon;
/** 审核状态 */
private String approvalStatus;
private String bloggerTypes;
/** 查询条件 */
private JSONObject params =new JSONObject();
}

View File

@ -1,72 +1,49 @@
<?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.busi.mapper.BusiNoticeMapper">
<resultMap type="BusiNotice" id="BusiNoticeResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="title" column="title" />
<result property="platformCode" column="platform_code" />
<result property="platformName" column="platform_name" />
<result property="country" column="country" />
<result property="feeDown" column="fee_down" />
<result property="feeUp" column="fee_up" />
<result property="isSelfPrice" column="is_self_price" />
<result property="giftDetail" column="gift_detail" />
<result property="giftPrice" column="gift_price" />
<result property="endDate" column="end_date" />
<result property="brand" column="brand" />
<result property="isShowBrand" column="is_show_brand" />
<result property="needNum" column="need_num" />
<result property="fansDown" column="fans_down" />
<result property="fansUp" column="fans_up" />
<result property="isEligible" column="is_eligible" />
<result property="pic" column="pic" />
<result property="collect" column="collect" />
<result property="detail" column="detail" />
<result property="images" column="images" />
<result property="bloggerTypes" column="blogger_types" />
<result property="isShowTel" column="is_show_tel" />
<result property="wechat" column="wechat" />
<result property="tel" column="tel" />
<result property="groupImage" column="group_image" />
<result property="isUseCoupon" column="is_use_coupon" />
<result property="approvalStatus" column="approval_status" />
<result property="approvalUserId" column="approval_user_id" />
<result property="approvalTime" column="approval_time" />
<result property="approvalRemark" column="approval_remark" />
<result property="creator" column="creator" />
<result property="createTime" column="create_time" />
<result property="updater" column="updater" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectBusiNoticeVo">
select id, user_id, title, platform_code, platform_name, country, fee_down, fee_up, is_self_price, gift_detail, gift_price, end_date, brand, is_show_brand, need_num, fans_down, fans_up, is_eligible, pic, collect, detail, images, blogger_types, is_show_tel, wechat, tel, group_image, is_use_coupon, approval_status, approval_user_id, approval_time, approval_remark, creator, create_time, updater, update_time, del_flag from dl_busi_notice
</sql>
<select id="queryListPage" parameterType="BusiNotice" resultMap="BusiNoticeResult">
<include refid="selectBusiNoticeVo"/>
<select id="queryListPage" parameterType="BusiNotice" resultType="com.ruoyi.busi.vo.BusiNoticeVo">
select main.id, main.user_id, main.title, main.platform_code, main.province, main.city, main.fee_down, main.fee_up, main.is_self_price, main.gift_detail,
main.gift_price, main.end_date, main.brand, main.is_show_brand, main.need_num, main.fans_down, main.fans_up, main.is_eligible, main.pic, main.collect, main.detail, main.images,
main.blogger_types, main.is_show_tel, main.wechat, main.tel, main.group_image, main.is_use_coupon, main.approval_status, main.approval_user_id, main.approval_time,
main.approval_remark, main.creator, main.create_time, main.updater, main.update_time, main.del_flag,
uTable.nick_name as userNickName,
bTable.title as platformName
from dl_busi_notice main
left join sys_user uTable on main.user_id = uTable.user_id
left join dl_base_category bTable on main.platform_code = bTable.code
<where>
<if test="entity.userId != null "> and user_id like concat('%', #{entity.userId}, '%')</if>
<if test="entity.title != null and entity.title != ''"> and title like concat('%', #{entity.title}, '%')</if>
<if test="entity.platformName != null and entity.platformName != ''"> and platform_name like concat('%', #{entity.platformName}, '%')</if>
<if test="entity.country != null and entity.country != ''"> and country = #{entity.country}</if>
<if test="entity.feeDown != null "> and fee_down = #{entity.feeDown}</if>
<if test="entity.feeUp != null "> and fee_up = #{entity.feeUp}</if>
<if test="entity.isSelfPrice != null "> and is_self_price = #{entity.isSelfPrice}</if>
<if test="entity.brand != null and entity.brand != ''"> and brand = #{entity.brand}</if>
<if test="entity.isShowBrand != null "> and is_show_brand = #{entity.isShowBrand}</if>
<if test="entity.needNum != null "> and need_num = #{entity.needNum}</if>
<if test="entity.fansDown != null "> and fans_down = #{entity.fansDown}</if>
<if test="entity.fansUp != null "> and fans_up = #{entity.fansUp}</if>
<if test="entity.isEligible != null "> and is_eligible = #{entity.isEligible}</if>
<if test="entity.pic != null and entity.pic != ''"> and pic = #{entity.pic}</if>
<if test="entity.collect != null and entity.collect != ''"> and collect = #{entity.collect}</if>
<if test="entity.detail != null and entity.detail != ''"> and detail = #{entity.detail}</if>
main.del_flag = '0'
<if test="entity.userNickName != null "> and uTable.nick_name like concat('%', #{entity.userNickName}, '%')</if>
<if test="entity.province != null "> and main.province = #{entity.province}</if>
<if test="entity.city != null "> and main.city = #{entity.city}</if>
<if test="entity.title != null and entity.title != ''"> and main.title like concat('%', #{entity.title}, '%')</if>
<if test="entity.platformCode != null and entity.platformCode != ''"> and main.platform_code = #{entity.platformCode}</if>
<if test="entity.params.beginFeeDown != null and entity.params.beginFeeDown != ''">
and main.fee_down <![CDATA[>= ]]> #{entity.params.beginFeeDown}
</if>
<if test=" entity.params.endFeeDown != null and entity.params.endFeeDown != ''">
and main.fee_down <![CDATA[<= ]]> #{entity.params.endFeeDown}
</if>
<if test="entity.params.beginFansDown != null and entity.params.beginFansDown != ''">
and main.fans_down <![CDATA[>= ]]> #{entity.params.beginFansDown}
</if>
<if test=" entity.params.endFansDown != null and entity.params.endFansDown != ''">
and main.fans_down <![CDATA[<= ]]> #{entity.params.endFansDown}
</if>
<if test="entity.brand != null and entity.brand != ''"> and main.brand like concat('%', #{entity.brand}, '%')</if>
<if test="entity.pic != null and entity.pic != ''"> and main.pic = #{entity.pic}</if>
<if test="entity.collect != null and entity.collect != ''"> and main.collect = #{entity.collect}</if>
<if test="entity.bloggerTypes != null and entity.bloggerTypes != ''"> and main.blogger_types = #{entity.bloggerTypes}</if>
<if test="entity.isUseCoupon != null "> and main.is_use_coupon = #{entity.isUseCoupon}</if>
<if test="entity.approvalStatus != null and entity.approvalStatus != ''"> and main.approval_status = #{entity.approvalStatus}</if>
<if test="entity.params.beginCreateTime != null and entity.params.beginCreateTime != '' and entity.params.endCreateTime != null and entity.params.endCreateTime != ''"> and main.create_time between #{entity.params.beginCreateTime} and #{entity.params.endCreateTime}</if>
</where>
</select>
</mapper>
</mapper>

View File

@ -1,5 +1,6 @@
package com.ruoyi.common.core.domain;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
@ -12,7 +13,7 @@ import java.util.Date;
/**
* Entity基类--点亮
*
*
* @author ruoyi
*/
@Data
@ -43,4 +44,8 @@ public class DlBaseEntity implements Serializable
@TableLogic
private String delFlag;
/** 查询条件 */
@TableField(exist = false)
private JSONObject params =new JSONObject();
}