包工头消息
This commit is contained in:
		@ -0,0 +1,76 @@
 | 
			
		||||
package com.ruoyi.bgt.bo;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.time.LocalTime;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.core.domain.BaseEntity;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息分页查询对象 bgt_message
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 * @date 2025-02-25
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@ApiModel("消息分页查询对象")
 | 
			
		||||
public class BgtMessageQueryBo extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
	/** 分页大小 */
 | 
			
		||||
	@ApiModelProperty("分页大小")
 | 
			
		||||
	private Integer pageSize;
 | 
			
		||||
	/** 当前页数 */
 | 
			
		||||
	@ApiModelProperty("当前页数")
 | 
			
		||||
	private Integer pageNum;
 | 
			
		||||
	/** 排序列 */
 | 
			
		||||
	@ApiModelProperty("排序列")
 | 
			
		||||
	private String orderByColumn;
 | 
			
		||||
	/** 排序的方向desc或者asc */
 | 
			
		||||
	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
 | 
			
		||||
	private String isAsc;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/** 发送类型(0系统 1务工者 2包工头) */
 | 
			
		||||
	@ApiModelProperty("发送类型(0系统 1务工者 2包工头)")
 | 
			
		||||
	private String senderType;
 | 
			
		||||
	/** 发送人 */
 | 
			
		||||
	@ApiModelProperty("发送人")
 | 
			
		||||
	private Long senderId;
 | 
			
		||||
	/** 接收类型(1务工者 2包工头) */
 | 
			
		||||
	@ApiModelProperty("接收类型(1务工者 2包工头)")
 | 
			
		||||
	private String recipientType;
 | 
			
		||||
	/** 接收人 */
 | 
			
		||||
	@ApiModelProperty("接收人")
 | 
			
		||||
	private Long recipientId;
 | 
			
		||||
	/** 标题 */
 | 
			
		||||
	@ApiModelProperty("标题")
 | 
			
		||||
	private String headline;
 | 
			
		||||
	/** 副标题 */
 | 
			
		||||
	@ApiModelProperty("副标题")
 | 
			
		||||
	private String subheading;
 | 
			
		||||
	/** 表ID */
 | 
			
		||||
	@ApiModelProperty("表ID")
 | 
			
		||||
	private Long tableId;
 | 
			
		||||
	/** 表名 */
 | 
			
		||||
	@ApiModelProperty("表名")
 | 
			
		||||
	private String tableName;
 | 
			
		||||
	/** 大类型(字典bgt_message_large_type) */
 | 
			
		||||
	@ApiModelProperty("大类型(字典bgt_message_large_type)")
 | 
			
		||||
	private String messageLargeType;
 | 
			
		||||
	/** 小类型(字典bgt_message_small_type) */
 | 
			
		||||
	@ApiModelProperty("小类型(字典bgt_message_small_type)")
 | 
			
		||||
	private String messageSmallType;
 | 
			
		||||
	/** 读状态(0未读 1已读) */
 | 
			
		||||
	@ApiModelProperty("读状态(0未读 1已读)")
 | 
			
		||||
	private String readStatus;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										128
									
								
								ruoyi-system/src/main/java/com/ruoyi/bgt/domain/BgtMessage.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										128
									
								
								ruoyi-system/src/main/java/com/ruoyi/bgt/domain/BgtMessage.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,128 @@
 | 
			
		||||
package com.ruoyi.bgt.domain;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.annotation.Excel;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.*;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.time.LocalTime;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息对象 bgt_message
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 * @date 2025-02-25
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@TableName("bgt_message")
 | 
			
		||||
@ApiModel("消息视图对象")
 | 
			
		||||
public class BgtMessage implements Serializable {
 | 
			
		||||
 | 
			
		||||
    private static final long serialVersionUID=1L;
 | 
			
		||||
 | 
			
		||||
    /** 主键自增ID */
 | 
			
		||||
    @ApiModelProperty("主键自增ID")
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /** 发送类型(0系统 1务工者 2包工头) */
 | 
			
		||||
    @Excel(name = "发送类型" , readConverterExp = "0=系统,1=务工者,2=包工头")
 | 
			
		||||
    @ApiModelProperty("发送类型(0系统 1务工者 2包工头)")
 | 
			
		||||
    private String senderType;
 | 
			
		||||
 | 
			
		||||
    /** 发送人 */
 | 
			
		||||
    @Excel(name = "发送人")
 | 
			
		||||
    @ApiModelProperty("发送人")
 | 
			
		||||
    private Long senderId;
 | 
			
		||||
 | 
			
		||||
    /** 接收类型(1务工者 2包工头) */
 | 
			
		||||
    @Excel(name = "接收类型" , readConverterExp = "1=务工者,2=包工头")
 | 
			
		||||
    @ApiModelProperty("接收类型(1务工者 2包工头)")
 | 
			
		||||
    private String recipientType;
 | 
			
		||||
 | 
			
		||||
    /** 接收人 */
 | 
			
		||||
    @Excel(name = "接收人")
 | 
			
		||||
    @ApiModelProperty("接收人")
 | 
			
		||||
    private Long recipientId;
 | 
			
		||||
 | 
			
		||||
    /** 标题 */
 | 
			
		||||
    @Excel(name = "标题")
 | 
			
		||||
    @ApiModelProperty("标题")
 | 
			
		||||
    private String headline;
 | 
			
		||||
 | 
			
		||||
    /** 副标题 */
 | 
			
		||||
    @Excel(name = "副标题")
 | 
			
		||||
    @ApiModelProperty("副标题")
 | 
			
		||||
    private String subheading;
 | 
			
		||||
 | 
			
		||||
    /** 表ID */
 | 
			
		||||
    @Excel(name = "表ID")
 | 
			
		||||
    @ApiModelProperty("表ID")
 | 
			
		||||
    private Long tableId;
 | 
			
		||||
 | 
			
		||||
    /** 表名 */
 | 
			
		||||
    @Excel(name = "表名")
 | 
			
		||||
    @ApiModelProperty("表名")
 | 
			
		||||
    private String tableName;
 | 
			
		||||
 | 
			
		||||
    /** 大类型(字典bgt_message_large_type) */
 | 
			
		||||
    @Excel(name = "大类型" , readConverterExp = "字=典bgt_message_large_type")
 | 
			
		||||
    @ApiModelProperty("大类型(字典bgt_message_large_type)")
 | 
			
		||||
    private String messageLargeType;
 | 
			
		||||
 | 
			
		||||
    /** 小类型(字典bgt_message_small_type) */
 | 
			
		||||
    @Excel(name = "小类型" , readConverterExp = "字=典bgt_message_small_type")
 | 
			
		||||
    @ApiModelProperty("小类型(字典bgt_message_small_type)")
 | 
			
		||||
    private String messageSmallType;
 | 
			
		||||
 | 
			
		||||
    /** 读状态(0未读 1已读) */
 | 
			
		||||
    @Excel(name = "读状态" , readConverterExp = "0=未读,1=已读")
 | 
			
		||||
    @ApiModelProperty("读状态(0未读 1已读)")
 | 
			
		||||
    private String readStatus;
 | 
			
		||||
 | 
			
		||||
    /** 删除标志(0代表存在 2代表删除) */
 | 
			
		||||
    @Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除")
 | 
			
		||||
    @ApiModelProperty("删除标志(0代表存在 2代表删除)")
 | 
			
		||||
    private String delFlag;
 | 
			
		||||
 | 
			
		||||
    /** 创建者 */
 | 
			
		||||
    @Excel(name = "创建者")
 | 
			
		||||
    @ApiModelProperty("创建者")
 | 
			
		||||
    @TableField(fill = FieldFill.INSERT)
 | 
			
		||||
    private String createBy;
 | 
			
		||||
 | 
			
		||||
    /** 创建时间 */
 | 
			
		||||
    @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
 | 
			
		||||
    @ApiModelProperty("创建时间")
 | 
			
		||||
    @TableField(fill = FieldFill.INSERT)
 | 
			
		||||
    private LocalDateTime createTime;
 | 
			
		||||
 | 
			
		||||
    /** 更新者 */
 | 
			
		||||
    @Excel(name = "更新者")
 | 
			
		||||
    @ApiModelProperty("更新者")
 | 
			
		||||
    @TableField(fill = FieldFill.INSERT_UPDATE)
 | 
			
		||||
    private String updateBy;
 | 
			
		||||
 | 
			
		||||
    /** 更新时间 */
 | 
			
		||||
    @Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
 | 
			
		||||
    @ApiModelProperty("更新时间")
 | 
			
		||||
    @TableField(fill = FieldFill.INSERT_UPDATE)
 | 
			
		||||
    private LocalDateTime updateTime;
 | 
			
		||||
 | 
			
		||||
    /** 备注 */
 | 
			
		||||
    @Excel(name = "备注")
 | 
			
		||||
    @ApiModelProperty("备注")
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,18 @@
 | 
			
		||||
package com.ruoyi.bgt.mapper;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtMessage;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
 | 
			
		||||
import org.apache.ibatis.annotations.CacheNamespace;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 * @date 2025-02-25
 | 
			
		||||
 */
 | 
			
		||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
 | 
			
		||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
 | 
			
		||||
public interface BgtMessageMapper extends BaseMapperPlus<BgtMessage> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,55 @@
 | 
			
		||||
package com.ruoyi.bgt.service;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtMessage;
 | 
			
		||||
import com.ruoyi.bgt.bo.BgtMessageQueryBo;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 * @date 2025-02-25
 | 
			
		||||
 */
 | 
			
		||||
public interface IBgtMessageService extends IServicePlus<BgtMessage> {
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询单个
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    BgtMessage queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<BgtMessage> queryPageList(BgtMessageQueryBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询列表
 | 
			
		||||
     */
 | 
			
		||||
    List<BgtMessage> queryList(BgtMessageQueryBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据新增业务对象插入消息
 | 
			
		||||
     * @param bo 消息新增业务对象
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insert(BgtMessage bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据编辑业务对象修改消息
 | 
			
		||||
     * @param bo 消息编辑业务对象
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean update(BgtMessage bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并删除数据
 | 
			
		||||
     * @param ids 主键集合
 | 
			
		||||
     * @param isValid 是否校验,true-删除前校验,false-不校验
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,94 @@
 | 
			
		||||
package com.ruoyi.bgt.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.core.page.PagePlus;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import com.ruoyi.bgt.bo.BgtMessageQueryBo;
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtMessage;
 | 
			
		||||
import com.ruoyi.bgt.mapper.BgtMessageMapper;
 | 
			
		||||
import com.ruoyi.bgt.service.IBgtMessageService;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 * @date 2025-02-25
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, BgtMessage> implements IBgtMessageService {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public BgtMessage queryById(Long id){
 | 
			
		||||
        return getById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<BgtMessage> queryPageList(BgtMessageQueryBo bo) {
 | 
			
		||||
        Page<BgtMessage> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
 | 
			
		||||
        return PageUtils.buildDataInfo(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BgtMessage> queryList(BgtMessageQueryBo bo) {
 | 
			
		||||
        return list(buildQueryWrapper(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private LambdaQueryWrapper<BgtMessage> buildQueryWrapper(BgtMessageQueryBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<BgtMessage> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getSenderType()), BgtMessage::getSenderType, bo.getSenderType());
 | 
			
		||||
        lqw.eq(bo.getSenderId() != null, BgtMessage::getSenderId, bo.getSenderId());
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getRecipientType()), BgtMessage::getRecipientType, bo.getRecipientType());
 | 
			
		||||
        lqw.eq(bo.getRecipientId() != null, BgtMessage::getRecipientId, bo.getRecipientId());
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getHeadline()), BgtMessage::getHeadline, bo.getHeadline());
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getSubheading()), BgtMessage::getSubheading, bo.getSubheading());
 | 
			
		||||
        lqw.eq(bo.getTableId() != null, BgtMessage::getTableId, bo.getTableId());
 | 
			
		||||
        lqw.like(StrUtil.isNotBlank(bo.getTableName()), BgtMessage::getTableName, bo.getTableName());
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getMessageLargeType()), BgtMessage::getMessageLargeType, bo.getMessageLargeType());
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getMessageSmallType()), BgtMessage::getMessageSmallType, bo.getMessageSmallType());
 | 
			
		||||
        lqw.eq(StrUtil.isNotBlank(bo.getReadStatus()), BgtMessage::getReadStatus, bo.getReadStatus());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean insert(BgtMessage bo) {
 | 
			
		||||
        BgtMessage add = BeanUtil.toBean(bo, BgtMessage.class);
 | 
			
		||||
        validEntityBeforeSave(add);
 | 
			
		||||
        return save(add);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean update(BgtMessage bo) {
 | 
			
		||||
        BgtMessage update = BeanUtil.toBean(bo, BgtMessage.class);
 | 
			
		||||
        validEntityBeforeSave(update);
 | 
			
		||||
        return updateById(update);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     *
 | 
			
		||||
     * @param entity 实体类数据
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(BgtMessage entity){
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
        }
 | 
			
		||||
        return removeByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,26 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.req;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.annotation.Excel;
 | 
			
		||||
import com.ruoyi.common.bo.PageReq;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.Hidden;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("获取消息列表请求参数")
 | 
			
		||||
public class WgzAppGetMessageListReq extends PageReq {
 | 
			
		||||
	@ApiModelProperty("接收人")
 | 
			
		||||
	@Hidden
 | 
			
		||||
	private Long recipientId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("大类型(字典)")
 | 
			
		||||
	private String messageLargeType;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("小类型(字典,大类型为【其它】才复制给它)")
 | 
			
		||||
	private String messageSmallType;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("获取消息列表返回参数")
 | 
			
		||||
public class WgzAppGetMessageListRes implements Serializable {
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user