分包商
This commit is contained in:
@ -0,0 +1,79 @@
|
||||
package com.ruoyi.fbs.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;
|
||||
|
||||
/**
|
||||
* 消息分页查询对象 fbs_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-28
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("消息分页查询对象")
|
||||
public class FbsMessageQueryBo 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包工头 3分包商 4总包方) */
|
||||
@ApiModelProperty("发送类型(0系统 1务工者 2包工头 3分包商 4总包方)")
|
||||
private String senderType;
|
||||
/** 发送人 */
|
||||
@ApiModelProperty("发送人")
|
||||
private Long senderId;
|
||||
/** 接收类型(1务工者 2包工头 3分包商 4总包方) */
|
||||
@ApiModelProperty("接收类型(1务工者 2包工头 3分包商 4总包方)")
|
||||
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;
|
||||
/** 是否需要操作(0不需要 1需要 2已操作) */
|
||||
@ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)")
|
||||
private String isOperation;
|
||||
|
||||
}
|
||||
133
ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsMessage.java
Normal file
133
ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsMessage.java
Normal file
@ -0,0 +1,133 @@
|
||||
package com.ruoyi.fbs.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;
|
||||
|
||||
/**
|
||||
* 消息对象 fbs_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-28
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("fbs_message")
|
||||
@ApiModel("消息视图对象")
|
||||
public class FbsMessage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键自增ID */
|
||||
@ApiModelProperty("主键自增ID")
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 发送类型(0系统 1务工者 2包工头 3分包商 4总包方) */
|
||||
@Excel(name = "发送类型" , readConverterExp = "0=系统,1=务工者,2=包工头,3=分包商,4=总包方")
|
||||
@ApiModelProperty("发送类型(0系统 1务工者 2包工头 3分包商 4总包方)")
|
||||
private String senderType;
|
||||
|
||||
/** 发送人 */
|
||||
@Excel(name = "发送人")
|
||||
@ApiModelProperty("发送人")
|
||||
private Long senderId;
|
||||
|
||||
/** 接收类型(1务工者 2包工头 3分包商 4总包方) */
|
||||
@Excel(name = "接收类型" , readConverterExp = "1=务工者,2=包工头,3=分包商,4=总包方")
|
||||
@ApiModelProperty("接收类型(1务工者 2包工头 3分包商 4总包方)")
|
||||
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不需要 1需要 2已操作) */
|
||||
@Excel(name = "是否需要操作" , readConverterExp = "0=不需要,1=需要,2=已操作")
|
||||
@ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)")
|
||||
private String isOperation;
|
||||
|
||||
}
|
||||
@ -1,9 +1,7 @@
|
||||
package com.ruoyi.fbs.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -32,7 +30,7 @@ public class FbsWageApplication implements Serializable {
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 项目ID */
|
||||
@ -98,6 +96,7 @@ public class FbsWageApplication implements Serializable {
|
||||
/** 申请时间 */
|
||||
@Excel(name = "申请时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("申请时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
/** 用工情况 */
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.fbs.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("分包商消息详情查询对象")
|
||||
public class FbsMessageDetailDTO {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate date;
|
||||
|
||||
@ApiModelProperty("大类型(字典bgt_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("是否待处理")
|
||||
private Boolean isHandle = false;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.fbs.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("消息列表查询对象")
|
||||
public class FbsMessageMyListDTO {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.fbs.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("分包商项目列表查询条件")
|
||||
public class FbsProjectSectionListDTO {
|
||||
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("项目Id")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty(value = "分包商Id",hidden = true)
|
||||
private Long fbsUserId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.fbs.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 包工头工资申请分页查询对象 bgt_wage_application
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("App包工头工资申请分页查询对象")
|
||||
public class FbsWageAuditDTO {
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未通过)")
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.fbs.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 包工头工资申请分页查询对象 bgt_wage_application
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("App包工头工资申请分页查询对象")
|
||||
public class FbsWageAuditListDTO {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty("任务名")
|
||||
private String taskName;
|
||||
/** 申请人ID */
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long reviewerId;
|
||||
/** 审核状态(1审核中 2已审核 3未审核) */
|
||||
// @ApiModelProperty("审核状态(1审核中 2已审核 3未通过)")
|
||||
// private String auditStatus;
|
||||
|
||||
@ApiModelProperty("筛选(1申请中 2已结算)")
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.ruoyi.fbs.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("分包商未读消息统计视图对象")
|
||||
public class FbsMessageCountVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("申请消息")
|
||||
private Integer taskMessageCount;
|
||||
|
||||
@ApiModelProperty("结算消息")
|
||||
private Integer settlementMessageCount;
|
||||
|
||||
@ApiModelProperty("其他消息")
|
||||
private Integer otherMessageCount;
|
||||
|
||||
@ApiModelProperty("待处理消息")
|
||||
private Integer handleMessageCount;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.ruoyi.fbs.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("分包商消息列表详情视图对象")
|
||||
public class FbsMessageDetailVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("发送人")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long senderId;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("大类型(字典bgt_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)")
|
||||
private String isOperation ;
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.fbs.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("分包商消息列表视图对象")
|
||||
public class FbsMessageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("发送人")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long senderId;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("大类型(字典bgt_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.fbs.mapper;
|
||||
|
||||
import com.ruoyi.fbs.domain.FbsMessage;
|
||||
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-03-28
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface FbsMessageMapper extends BaseMapperPlus<FbsMessage> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ruoyi.fbs.service;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.fbs.bo.FbsMessageQueryBo;
|
||||
import com.ruoyi.fbs.domain.FbsMessage;
|
||||
import com.ruoyi.fbs.domain.dto.FbsMessageDetailDTO;
|
||||
import com.ruoyi.fbs.domain.dto.FbsMessageMyListDTO;
|
||||
import com.ruoyi.fbs.domain.vo.FbsMessageCountVO;
|
||||
import com.ruoyi.fbs.domain.vo.FbsMessageDetailVO;
|
||||
import com.ruoyi.fbs.domain.vo.FbsMessageVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-28
|
||||
*/
|
||||
public interface IFbsMessageService extends IServicePlus<FbsMessage> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
FbsMessage queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<FbsMessage> queryPageList(FbsMessageQueryBo bo);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<FbsMessage> queryList(FbsMessageQueryBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入消息
|
||||
* @param bo 消息新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insert(FbsMessage bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改消息
|
||||
* @param bo 消息编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean update(FbsMessage bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 分包商的未读消息统计
|
||||
*/
|
||||
FbsMessageCountVO countUnread();
|
||||
|
||||
/**
|
||||
* 分包商的消息列表
|
||||
*/
|
||||
TableDataInfo<FbsMessageVO> queryMyPageList(FbsMessageMyListDTO dto);
|
||||
|
||||
/**
|
||||
* 消息详情列表
|
||||
*/
|
||||
TableDataInfo<FbsMessageDetailVO> queryDetailPageList(FbsMessageDetailDTO dto);
|
||||
}
|
||||
@ -0,0 +1,207 @@
|
||||
package com.ruoyi.fbs.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BgtMessageType;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.bo.FbsMessageQueryBo;
|
||||
import com.ruoyi.fbs.domain.FbsMessage;
|
||||
import com.ruoyi.fbs.domain.dto.FbsMessageDetailDTO;
|
||||
import com.ruoyi.fbs.domain.dto.FbsMessageMyListDTO;
|
||||
import com.ruoyi.fbs.domain.vo.FbsMessageCountVO;
|
||||
import com.ruoyi.fbs.domain.vo.FbsMessageDetailVO;
|
||||
import com.ruoyi.fbs.domain.vo.FbsMessageVO;
|
||||
import com.ruoyi.fbs.mapper.FbsMessageMapper;
|
||||
import com.ruoyi.fbs.service.IFbsMessageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.OPERATION_NEED;
|
||||
|
||||
/**
|
||||
* 消息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-28
|
||||
*/
|
||||
@Service
|
||||
public class FbsMessageServiceImpl extends ServicePlusImpl<FbsMessageMapper, FbsMessage> implements IFbsMessageService {
|
||||
|
||||
@Override
|
||||
public FbsMessage queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<FbsMessage> queryPageList(FbsMessageQueryBo bo) {
|
||||
Page<FbsMessage> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FbsMessage> queryList(FbsMessageQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<FbsMessage> buildQueryWrapper(FbsMessageQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<FbsMessage> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getSenderType()), FbsMessage::getSenderType, bo.getSenderType());
|
||||
lqw.eq(bo.getSenderId() != null, FbsMessage::getSenderId, bo.getSenderId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getRecipientType()), FbsMessage::getRecipientType, bo.getRecipientType());
|
||||
lqw.eq(bo.getRecipientId() != null, FbsMessage::getRecipientId, bo.getRecipientId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getHeadline()), FbsMessage::getHeadline, bo.getHeadline());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getSubheading()), FbsMessage::getSubheading, bo.getSubheading());
|
||||
lqw.eq(bo.getTableId() != null, FbsMessage::getTableId, bo.getTableId());
|
||||
lqw.like(StrUtil.isNotBlank(bo.getTableName()), FbsMessage::getTableName, bo.getTableName());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getMessageLargeType()), FbsMessage::getMessageLargeType, bo.getMessageLargeType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getMessageSmallType()), FbsMessage::getMessageSmallType, bo.getMessageSmallType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getReadStatus()), FbsMessage::getReadStatus, bo.getReadStatus());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getIsOperation()), FbsMessage::getIsOperation, bo.getIsOperation());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(FbsMessage bo) {
|
||||
FbsMessage add = BeanUtil.toBean(bo, FbsMessage.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(FbsMessage bo) {
|
||||
FbsMessage update = BeanUtil.toBean(bo, FbsMessage.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(FbsMessage entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FbsMessageCountVO countUnread() {
|
||||
List<FbsMessage> fbsMessages = baseMapper.selectList(Wrappers.<FbsMessage>lambdaQuery()
|
||||
.eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId())
|
||||
.eq(FbsMessage::getReadStatus, "0"));
|
||||
Map<String, Long> map = fbsMessages.stream().collect(Collectors.groupingBy(FbsMessage::getMessageLargeType, Collectors.counting()));
|
||||
|
||||
FbsMessageCountVO fbsMessageCountVO = new FbsMessageCountVO();
|
||||
fbsMessageCountVO.setTaskMessageCount(map.getOrDefault(BgtMessageType.TASK.getCode(), 0L).intValue());
|
||||
fbsMessageCountVO.setSettlementMessageCount(map.getOrDefault(BgtMessageType.SETTLEMENT.getCode(), 0L).intValue());
|
||||
fbsMessageCountVO.setOtherMessageCount(map.getOrDefault(BgtMessageType.OTHER.getCode(), 0L).intValue());
|
||||
|
||||
Integer handle = baseMapper.selectCount(Wrappers.<FbsMessage>lambdaQuery()
|
||||
.eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId())
|
||||
.eq(FbsMessage::getIsOperation, OPERATION_NEED));
|
||||
fbsMessageCountVO.setHandleMessageCount(handle);
|
||||
return fbsMessageCountVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<FbsMessageVO> queryMyPageList(FbsMessageMyListDTO dto) {
|
||||
LambdaQueryWrapper<FbsMessage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId());
|
||||
wrapper.orderByDesc(FbsMessage::getCreateTime);
|
||||
Page<FbsMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<FbsMessageVO> fbsMessageVOPage = new Page<>();
|
||||
fbsMessageVOPage.setTotal(result.getTotal());
|
||||
fbsMessageVOPage.setRecords(BeanUtil.copyToList(result.getRecords(), FbsMessageVO.class));
|
||||
return PageUtils.buildDataInfo(fbsMessageVOPage);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<FbsMessageDetailVO> queryDetailPageList(FbsMessageDetailDTO dto) {
|
||||
LambdaQueryWrapper<FbsMessage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId());
|
||||
wrapper.eq(StrUtil.isNotBlank(dto.getMessageLargeType()), FbsMessage::getMessageLargeType, dto.getMessageLargeType());
|
||||
wrapper.eq(StrUtil.isNotBlank(dto.getMessageSmallType()), FbsMessage::getMessageSmallType, dto.getMessageSmallType());
|
||||
wrapper.eq(dto.getIsHandle(), FbsMessage::getIsOperation,OPERATION_NEED);
|
||||
if(dto.getDate() != null) {
|
||||
wrapper.between(FbsMessage::getCreateTime, dto.getDate().atStartOfDay(), dto.getDate().atStartOfDay().with(LocalTime.MAX));
|
||||
}
|
||||
wrapper.orderByDesc(FbsMessage::getId);
|
||||
Page<FbsMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<FbsMessageDetailVO> page = new Page<>();
|
||||
page.setTotal(result.getTotal());
|
||||
|
||||
ArrayList<FbsMessageDetailVO> fbsMessageDetailVOS = new ArrayList<>();
|
||||
|
||||
for (FbsMessage message : result.getRecords()) {
|
||||
FbsMessageDetailVO fbsMessageDetailVO = BeanUtil.copyProperties(message, FbsMessageDetailVO.class);
|
||||
// if (BGT_LARGE_TASK.equals(message.getMessageLargeType())) {
|
||||
// FbsProjectTask task = taskService.getById(message.getTableId());
|
||||
// bgtMessageDetailVO.setTaskName(task.getTaskName());
|
||||
// } else if (BGT_LARGE_SETTLEMENT.equals(message.getMessageLargeType())) {
|
||||
// BgtWageApplication wageApplication = wageApplicationService.getById(message.getTableId());
|
||||
// FbsProjectTask task = taskService.getById(wageApplication.getTaskId());
|
||||
// bgtMessageDetailVO.setTaskName(task.getTaskName());
|
||||
// } else if (BGT_LARGE_OTHER.equals(message.getMessageLargeType())) {
|
||||
// switch (message.getMessageSmallType()) {
|
||||
// case BGT_SMALL_SIGN_UP:
|
||||
// BgtProjectRecruitApply recruitApply = recruitApplyService.getById(message.getTableId());
|
||||
// BgtProjectRecruit recruit = recruitService.getById(recruitApply.getRecruitId());
|
||||
// bgtMessageDetailVO.setRecruitName(recruit.getRecruitName());
|
||||
// break;
|
||||
// case BGT_SMALL_PAY:
|
||||
// WgzPayCalculation payCalculation = payCalculationService.getById(message.getTableId());
|
||||
// BgtProjectRecruit recruitPay = recruitService.getById(payCalculation.getRecruitId());
|
||||
// bgtMessageDetailVO.setRecruitName(recruitPay.getRecruitName());
|
||||
// break;
|
||||
// case BGT_SMALL_LEAVE:
|
||||
// WgzLeave wgzLeave = leaveService.getById(message.getTableId());
|
||||
// bgtMessageDetailVO.setReason(wgzLeave.getReason());
|
||||
// bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(wgzLeave.getUserId()).getUsername());
|
||||
// bgtMessageDetailVO.setStartTime(wgzLeave.getStartTime());
|
||||
// bgtMessageDetailVO.setEndTime(wgzLeave.getEndTime());
|
||||
// break;
|
||||
// case BGT_SMALL_MAKE_UP:
|
||||
// WgzReissueacard reissueCard = reissueacardService.getById(message.getTableId());
|
||||
// bgtMessageDetailVO.setReason(reissueCard.getReason());
|
||||
// bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(reissueCard.getUserId()).getUsername());
|
||||
// bgtMessageDetailVO.setNowTime(reissueCard.getNowTime());
|
||||
// break;
|
||||
// case BGT_SMALL_REPORT_MAKE_UP:
|
||||
// WgzDailyClock dailyClock = dailyClockService.getById(message.getTableId());
|
||||
// BgtProjectRecruit recruitClock = recruitService.getById(dailyClock.getRecruitId());
|
||||
// bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(dailyClock.getUserId()).getUsername());
|
||||
// bgtMessageDetailVO.setRecruitName(recruitClock.getRecruitName());
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
fbsMessageDetailVOS.add(fbsMessageDetailVO);
|
||||
}
|
||||
page.setRecords(fbsMessageDetailVOS);
|
||||
return PageUtils.buildDataInfo(page);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user