意见箱
This commit is contained in:
@ -41,7 +41,7 @@ spring:
|
||||
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||
chat:
|
||||
options:
|
||||
model: qwen-plus
|
||||
model: qwen3-max
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
package org.dromara.complaintBox.app.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.complaintBox.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 意见箱
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/app/complaintBox/complaintBox")
|
||||
public class AppBusComplaintBoxController extends BaseController {
|
||||
|
||||
@Lazy
|
||||
private final IBusComplaintBoxService busComplaintBoxService;
|
||||
@Lazy
|
||||
private final IBusComplaintBoxMessageLoggingService busComplaintBoxMessageLoggingService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询意见箱列表
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusComplaintBoxVo> list(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bo.setUserId(loginUser.getUserId());
|
||||
}
|
||||
return busComplaintBoxService.appQueryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取意见箱详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AppDetailsOfTheOpinionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busComplaintBoxService.appQueryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:add")
|
||||
@Log(title = "意见箱", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.insertByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增意见回复
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:add")
|
||||
@Log(title = "意见箱", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/postAReply")
|
||||
public R<Void> postAReply(@Validated(AddGroup.class) @RequestBody BusComplaintBoxMessageLoggingBo bo) {
|
||||
return toAjax(busComplaintBoxMessageLoggingService.insertAppByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见阅读状态
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:edit")
|
||||
@Log(title = "意见箱", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/editCheckStatus")
|
||||
public R<Void> editCheckStatus(@Validated(EditGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.editCheckStatus(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package org.dromara.complaintBox.app.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AppDetailsOfTheOpinionVo implements Serializable {
|
||||
|
||||
private BusComplaintBoxVo busComplaintBoxVo;
|
||||
|
||||
private List<BusComplaintBoxMessageLoggingVo> messageLoggingVos;
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
package org.dromara.complaintBox.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/complaintBox/complaintBox")
|
||||
public class BusComplaintBoxController extends BaseController {
|
||||
|
||||
@Lazy
|
||||
private final IBusComplaintBoxService busComplaintBoxService;
|
||||
@Lazy
|
||||
private final IBusComplaintBoxMessageLoggingService busComplaintBoxMessageLoggingService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询意见箱列表
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusComplaintBoxVo> list(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
return busComplaintBoxService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* web获取各个处理状态数量
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:list")
|
||||
@GetMapping("/getCount")
|
||||
public R<List<ComplaintBoxCountVo>> getCount(BusComplaintBoxBo bo) {
|
||||
return R.ok(busComplaintBoxService.getCount(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取意见箱详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DetailsOfTheOpinionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busComplaintBoxService.getInfo(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见回复
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:add")
|
||||
@Log(title = "意见箱", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/postAReply")
|
||||
public R<Void> postAReply(@Validated(AddGroup.class) @RequestBody BusComplaintBoxMessageLoggingBo bo) {
|
||||
return toAjax(busComplaintBoxMessageLoggingService.insertWebByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改意见阅读状态
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:edit")
|
||||
@Log(title = "意见箱", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/editCheckStatus")
|
||||
public R<Void> editCheckStatus(@Validated(EditGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.editCheckStatus(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见阅读状态
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:edit")
|
||||
@Log(title = "意见箱", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/editStatus")
|
||||
public R<Void> editStatus(@Validated(EditGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.editStatus(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package org.dromara.complaintBox.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 意见箱对象 bus_complaint_box
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_complaint_box")
|
||||
public class BusComplaintBox extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id(当前登录人的顶层下一级部门id)
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 意见类型(1、功能建议,2、Bug反馈,3、体验问题,4其他意见)
|
||||
*/
|
||||
private String opinionType;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 上传图片(id,id之间使用','分割)
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 是否匿名提交(0、否,1、是)
|
||||
*/
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,10、退回,14、关闭)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 当前处理人id
|
||||
*/
|
||||
private Long currentDisposeUserId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package org.dromara.complaintBox.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录对象 bus_complaint_box_dispose_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_complaint_box_dispose_logging")
|
||||
public class BusComplaintBoxDisposeLogging extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 是否退回(0、否,1、是)
|
||||
*/
|
||||
private String isRefund;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package org.dromara.complaintBox.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录对象 bus_complaint_box_message_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_complaint_box_message_logging")
|
||||
public class BusComplaintBoxMessageLogging extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 回复用户id
|
||||
*/
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户名
|
||||
*/
|
||||
private String replyUserName;
|
||||
|
||||
/**
|
||||
* 回复用户头像地址
|
||||
*/
|
||||
private Long replyAvatar;
|
||||
|
||||
/**
|
||||
* 被回复用户id
|
||||
*/
|
||||
private Long repliedUserId;
|
||||
|
||||
/**
|
||||
* 被回复用户名
|
||||
*/
|
||||
private String repliedUserName;
|
||||
|
||||
/**
|
||||
* 被回复用户头像地址
|
||||
*/
|
||||
private Long repliedAvatar;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 处理状态(0、未读,1、已读)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package org.dromara.complaintBox.domain.bo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 意见箱业务对象 bus_complaint_box
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusComplaintBox.class, reverseConvertGenerate = false)
|
||||
public class BusComplaintBoxBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id(当前登录人的顶层下一级部门id)
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { AddGroup.class })
|
||||
private Long userId;
|
||||
/**
|
||||
* 当前处理人id
|
||||
*/
|
||||
private Long currentDisposeUserId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 意见类型(1、功能建议,2、Bug反馈,3、体验问题,4其他意见)
|
||||
*/
|
||||
private String opinionType;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 上传图片(id,id之间使用','分割)
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 是否匿名提交(0、否,1、是)
|
||||
*/
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,14、关闭)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package org.dromara.complaintBox.domain.bo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录业务对象 bus_complaint_box_dispose_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusComplaintBoxDisposeLogging.class, reverseConvertGenerate = false)
|
||||
public class BusComplaintBoxDisposeLoggingBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 是否退回(0、否,1、是)
|
||||
*/
|
||||
private String isRefund;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package org.dromara.complaintBox.domain.bo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录业务对象 bus_complaint_box_message_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusComplaintBoxMessageLogging.class, reverseConvertGenerate = false)
|
||||
public class BusComplaintBoxMessageLoggingBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 回复用户id
|
||||
*/
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户名
|
||||
*/
|
||||
private String replyUserName;
|
||||
|
||||
/**
|
||||
* 回复用户头像地址
|
||||
*/
|
||||
private Long replyAvatar;
|
||||
|
||||
/**
|
||||
* 被回复用户id
|
||||
*/
|
||||
private Long repliedUserId;
|
||||
|
||||
/**
|
||||
* 被回复用户名
|
||||
*/
|
||||
private String repliedUserName;
|
||||
|
||||
/**
|
||||
* 被回复用户头像地址
|
||||
*/
|
||||
private Long repliedAvatar;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 处理状态(0、未读,1、已读)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 上一条沟通记录id
|
||||
*/
|
||||
private Long oldId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录视图对象 bus_complaint_box_dispose_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusComplaintBoxDisposeLogging.class)
|
||||
public class BusComplaintBoxDisposeLoggingVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
@ExcelProperty(value = "意见id")
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ExcelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
@ExcelProperty(value = "头像地址")
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 是否退回(0、否,1、是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否退回", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、否,1、是")
|
||||
private String isRefund;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
@ExcelProperty(value = "退回原因")
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录视图对象 bus_complaint_box_message_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusComplaintBoxMessageLogging.class)
|
||||
public class BusComplaintBoxMessageLoggingVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
@ExcelProperty(value = "意见id")
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 回复用户id
|
||||
*/
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户名
|
||||
*/
|
||||
private String replyUserName;
|
||||
|
||||
/**
|
||||
* 回复用户头像地址
|
||||
*/
|
||||
private Long replyAvatar;
|
||||
private String replyAvatarUrl;
|
||||
|
||||
/**
|
||||
* 被回复用户id
|
||||
*/
|
||||
private Long repliedUserId;
|
||||
|
||||
/**
|
||||
* 被回复用户名
|
||||
*/
|
||||
private String repliedUserName;
|
||||
|
||||
/**
|
||||
* 被回复用户头像地址
|
||||
*/
|
||||
private Long repliedAvatar;
|
||||
private String repliedAvatarUrl;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
@ExcelProperty(value = "消息内容")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 处理状态(0、未读,1、已读)
|
||||
*/
|
||||
@ExcelProperty(value = "处理状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、未读,1、已读")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 发起人类型(0、发起人,1、处理人)
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 意见箱视图对象 bus_complaint_box
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusComplaintBox.class)
|
||||
public class BusComplaintBoxVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id(当前登录人的顶层下一级部门id)
|
||||
*/
|
||||
@ExcelProperty(value = "公司id", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "当=前登录人的顶层下一级部门id")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ExcelProperty(value = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ExcelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
@ExcelProperty(value = "头像地址")
|
||||
private Long avatar;
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 意见类型(1、功能建议,2、Bug反馈,3、体验问题,4其他意见)
|
||||
*/
|
||||
@ExcelProperty(value = "意见类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "1=、功能建议,2、Bug反馈,3、体验问题,4其他意见")
|
||||
private String opinionType;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
@ExcelProperty(value = "详细描述")
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 上传图片(id,id之间使用','分割)
|
||||
*/
|
||||
@ExcelProperty(value = "上传图片", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "i=d,id之间使用','分割")
|
||||
private String fileId;
|
||||
private List<String> fileUrls;
|
||||
|
||||
/**
|
||||
* 是否匿名提交(0、否,1、是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否匿名提交", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、否,1、是")
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,14、关闭)
|
||||
*/
|
||||
@ExcelProperty(value = "处理状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、待处理,5、处理中,9、已解决,14、关闭")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 当前处理人id
|
||||
*/
|
||||
private Long currentDisposeUserId;
|
||||
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ComplaintBoxCountVo implements Serializable {
|
||||
|
||||
private String type;
|
||||
|
||||
// @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "type",other = "opinion_processing_status")
|
||||
private String typeName;
|
||||
|
||||
private Integer count;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DetailsOfTheOpinionVo implements Serializable {
|
||||
|
||||
private BusComplaintBoxVo busComplaintBoxVo;
|
||||
|
||||
private List<BusComplaintBoxMessageLoggingVo> messageLoggingVos;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.complaintBox.mapper;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface BusComplaintBoxDisposeLoggingMapper extends BaseMapperPlus<BusComplaintBoxDisposeLogging, BusComplaintBoxDisposeLoggingVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package org.dromara.complaintBox.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface BusComplaintBoxMapper extends BaseMapperPlus<BusComplaintBox, BusComplaintBoxVo> {
|
||||
|
||||
Page<BusComplaintBoxVo> selectVoPageList(@Param("page") Page<BusComplaintBoxVo> page, @Param("bo") BusComplaintBoxBo bo);
|
||||
|
||||
Page<BusComplaintBoxVo> selectVoPageWebList(@Param("page") Page<BusComplaintBoxVo> page, @Param("bo") BusComplaintBoxBo bo);
|
||||
|
||||
List<ComplaintBoxCountVo> getCount(@Param("bo") BusComplaintBoxBo bo);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.complaintBox.mapper;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface BusComplaintBoxMessageLoggingMapper extends BaseMapperPlus<BusComplaintBoxMessageLogging, BusComplaintBoxMessageLoggingVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.complaintBox.service;
|
||||
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxDisposeLoggingBo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface IBusComplaintBoxDisposeLoggingService extends IService<BusComplaintBoxDisposeLogging>{
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见处理记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见处理记录
|
||||
*/
|
||||
BusComplaintBoxDisposeLoggingVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见处理记录分页列表
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxDisposeLoggingVo> queryPageList(BusComplaintBoxDisposeLoggingBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见处理记录列表
|
||||
*/
|
||||
List<BusComplaintBoxDisposeLoggingVo> queryList(BusComplaintBoxDisposeLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusComplaintBoxDisposeLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusComplaintBoxDisposeLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见处理记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package org.dromara.complaintBox.service;
|
||||
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface IBusComplaintBoxMessageLoggingService extends IService<BusComplaintBoxMessageLogging>{
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见沟通记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见沟通记录
|
||||
*/
|
||||
BusComplaintBoxMessageLoggingVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见沟通记录分页列表
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxMessageLoggingVo> queryPageList(BusComplaintBoxMessageLoggingBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见沟通记录列表
|
||||
*/
|
||||
List<BusComplaintBoxMessageLoggingVo> queryList(BusComplaintBoxMessageLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertAppByBo(BusComplaintBoxMessageLoggingBo bo);
|
||||
/**
|
||||
* 新增意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertWebByBo(BusComplaintBoxMessageLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusComplaintBoxMessageLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见沟通记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 通过意见id获取沟通记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<BusComplaintBoxMessageLoggingVo> getMessageLogListByComplaintId(Long id);
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package org.dromara.complaintBox.service;
|
||||
|
||||
import org.dromara.complaintBox.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface IBusComplaintBoxService extends IService<BusComplaintBox>{
|
||||
|
||||
/**
|
||||
* 查询意见箱
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱
|
||||
*/
|
||||
BusComplaintBoxVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱分页列表
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxVo> queryPageList(BusComplaintBoxBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱列表
|
||||
*/
|
||||
List<BusComplaintBoxVo> queryList(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 新增意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* app获取当前用户提出意见列表
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxVo> appQueryPageList(BusComplaintBoxBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* APP获取当前意见详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
AppDetailsOfTheOpinionVo appQueryById(Long id);
|
||||
|
||||
/**
|
||||
* 获取当前意见详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
DetailsOfTheOpinionVo getInfo(Long id);
|
||||
|
||||
/**
|
||||
* 修改沟通记录阅读状态
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
int editCheckStatus(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* web获取各个处理状态数量
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
List<ComplaintBoxCountVo> getCount(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见状态
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
int editStatus(BusComplaintBoxBo bo);
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
package org.dromara.complaintBox.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxDisposeLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxDisposeLoggingMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxDisposeLoggingService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusComplaintBoxDisposeLoggingServiceImpl extends ServiceImpl<BusComplaintBoxDisposeLoggingMapper, BusComplaintBoxDisposeLogging> implements IBusComplaintBoxDisposeLoggingService {
|
||||
|
||||
private final BusComplaintBoxDisposeLoggingMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见处理记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见处理记录
|
||||
*/
|
||||
@Override
|
||||
public BusComplaintBoxDisposeLoggingVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见处理记录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxDisposeLoggingVo> queryPageList(BusComplaintBoxDisposeLoggingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = buildQueryWrapper(bo);
|
||||
Page<BusComplaintBoxDisposeLoggingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见处理记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxDisposeLoggingVo> queryList(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusComplaintBoxDisposeLogging> buildQueryWrapper(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBoxDisposeLogging::getId);
|
||||
lqw.eq(bo.getComplaintId() != null, BusComplaintBoxDisposeLogging::getComplaintId, bo.getComplaintId());
|
||||
lqw.eq(bo.getUserId() != null, BusComplaintBoxDisposeLogging::getUserId, bo.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), BusComplaintBoxDisposeLogging::getUserName, bo.getUserName());
|
||||
lqw.eq(bo.getAvatar() != null, BusComplaintBoxDisposeLogging::getAvatar, bo.getAvatar());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsRefund()), BusComplaintBoxDisposeLogging::getIsRefund, bo.getIsRefund());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCause()), BusComplaintBoxDisposeLogging::getCause, bo.getCause());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
BusComplaintBoxDisposeLogging add = MapstructUtils.convert(bo, BusComplaintBoxDisposeLogging.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
BusComplaintBoxDisposeLogging update = MapstructUtils.convert(bo, BusComplaintBoxDisposeLogging.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusComplaintBoxDisposeLogging entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见处理记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,217 @@
|
||||
package org.dromara.complaintBox.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMessageLoggingMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusComplaintBoxMessageLoggingServiceImpl extends ServiceImpl<BusComplaintBoxMessageLoggingMapper, BusComplaintBoxMessageLogging> implements IBusComplaintBoxMessageLoggingService {
|
||||
|
||||
private final BusComplaintBoxMessageLoggingMapper baseMapper;
|
||||
@Lazy
|
||||
private final ISysUserService sysUserService;
|
||||
// @Lazy
|
||||
private final BusComplaintBoxMapper busComplaintBoxMapper;
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见沟通记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见沟通记录
|
||||
*/
|
||||
@Override
|
||||
public BusComplaintBoxMessageLoggingVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见沟通记录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxMessageLoggingVo> queryPageList(BusComplaintBoxMessageLoggingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusComplaintBoxMessageLogging> lqw = buildQueryWrapper(bo);
|
||||
Page<BusComplaintBoxMessageLoggingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见沟通记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxMessageLoggingVo> queryList(BusComplaintBoxMessageLoggingBo bo) {
|
||||
LambdaQueryWrapper<BusComplaintBoxMessageLogging> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusComplaintBoxMessageLogging> buildQueryWrapper(BusComplaintBoxMessageLoggingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBoxMessageLogging> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBoxMessageLogging::getId);
|
||||
lqw.eq(bo.getComplaintId() != null, BusComplaintBoxMessageLogging::getComplaintId, bo.getComplaintId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDetails()), BusComplaintBoxMessageLogging::getDetails, bo.getDetails());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusComplaintBoxMessageLogging::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertAppByBo(BusComplaintBoxMessageLoggingBo bo) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException("登录信息出错,请重新登录!!!");
|
||||
}
|
||||
BusComplaintBox busComplaintBox = busComplaintBoxMapper.selectById(bo.getComplaintId());
|
||||
if (busComplaintBox == null) {
|
||||
throw new ServiceException("意见信息找不到!!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus())){
|
||||
throw new ServiceException("意见已关闭!!!");
|
||||
}
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
bo.setReplyUserId(sysUserVo.getUserId());
|
||||
bo.setReplyUserName(sysUserVo.getNickName());
|
||||
bo.setReplyAvatar(sysUserVo.getAvatar());
|
||||
BusComplaintBoxMessageLogging add = MapstructUtils.convert(bo, BusComplaintBoxMessageLogging.class);
|
||||
if (busComplaintBox.getCurrentDisposeUserId() != null) {
|
||||
SysUserVo userVo = sysUserService.selectUserById(busComplaintBox.getCurrentDisposeUserId());
|
||||
if (userVo != null) {
|
||||
add.setRepliedUserId(userVo.getUserId());
|
||||
add.setRepliedUserName(userVo.getUserName());
|
||||
add.setRepliedAvatar(userVo.getAvatar());
|
||||
}
|
||||
}
|
||||
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertWebByBo(BusComplaintBoxMessageLoggingBo bo) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException("登录信息出错,请重新登录!!!");
|
||||
}
|
||||
BusComplaintBox busComplaintBox = busComplaintBoxMapper.selectById(bo.getComplaintId());
|
||||
if (busComplaintBox == null) {
|
||||
throw new ServiceException("意见信息找不到!!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus())){
|
||||
throw new ServiceException("意见已关闭!!!");
|
||||
}
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
bo.setReplyUserId(sysUserVo.getUserId());
|
||||
bo.setReplyUserName(sysUserVo.getNickName());
|
||||
bo.setReplyAvatar(sysUserVo.getAvatar());
|
||||
BusComplaintBoxMessageLogging add = MapstructUtils.convert(bo, BusComplaintBoxMessageLogging.class);
|
||||
add.setRepliedUserId(busComplaintBox.getUserId());
|
||||
add.setRepliedUserName(busComplaintBox.getUserName());
|
||||
add.setRepliedAvatar(busComplaintBox.getAvatar());
|
||||
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if ("0".equals(busComplaintBox.getStatus())){
|
||||
busComplaintBox.setStatus("5");
|
||||
busComplaintBox.setCurrentDisposeUserId(sysUserVo.getUserId());
|
||||
busComplaintBoxMapper.updateById(busComplaintBox);
|
||||
}
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusComplaintBoxMessageLoggingBo bo) {
|
||||
BusComplaintBoxMessageLogging update = MapstructUtils.convert(bo, BusComplaintBoxMessageLogging.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusComplaintBoxMessageLogging entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见沟通记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据意见id获取沟通记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxMessageLoggingVo> getMessageLogListByComplaintId(Long id) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>().eq(BusComplaintBoxMessageLogging::getComplaintId, id));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,333 @@
|
||||
package org.dromara.complaintBox.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.complaintBox.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMessageLoggingMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.dromara.system.domain.vo.SysDeptVo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysDeptService;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 意见箱Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMapper, BusComplaintBox> implements IBusComplaintBoxService {
|
||||
|
||||
private final BusComplaintBoxMapper baseMapper;
|
||||
// @Lazy
|
||||
private final BusComplaintBoxMessageLoggingMapper messageLoggingMapper;
|
||||
@Lazy
|
||||
private final ISysUserService sysUserService;
|
||||
@Lazy
|
||||
private final ISysDeptService sysDeptService;
|
||||
@Lazy
|
||||
private final ISysOssService sysOssService;
|
||||
|
||||
/**
|
||||
* 查询意见箱
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱
|
||||
*/
|
||||
@Override
|
||||
public BusComplaintBoxVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxVo> queryPageList(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
Page<BusComplaintBoxVo> result = baseMapper.selectVoPageWebList(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxVo> queryList(BusComplaintBoxBo bo) {
|
||||
LambdaQueryWrapper<BusComplaintBox> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusComplaintBox> buildQueryWrapper(BusComplaintBoxBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBox> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBox::getId);
|
||||
lqw.eq(bo.getCompanyId() != null, BusComplaintBox::getCompanyId, bo.getCompanyId());
|
||||
lqw.eq(bo.getProjectId() != null, BusComplaintBox::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getUserId() != null, BusComplaintBox::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getCurrentDisposeUserId() != null,
|
||||
BusComplaintBox::getCurrentDisposeUserId, bo.getCurrentDisposeUserId())
|
||||
.or()
|
||||
.isNull(BusComplaintBox::getCurrentDisposeUserId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BusComplaintBox::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOpinionType()), BusComplaintBox::getOpinionType, bo.getOpinionType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDetail()), BusComplaintBox::getDetail, bo.getDetail());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileId()), BusComplaintBox::getFileId, bo.getFileId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsCryptonym()), BusComplaintBox::getIsCryptonym, bo.getIsCryptonym());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusComplaintBox::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusComplaintBoxBo bo) {
|
||||
BusComplaintBox add = MapstructUtils.convert(bo, BusComplaintBox.class);
|
||||
//获取用户信息进行填充
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(add.getUserId());
|
||||
add.setAvatar(sysUserVo.getAvatar());
|
||||
add.setUserName(sysUserVo.getNickName());
|
||||
//获取部门信息
|
||||
SysDeptVo sysDeptVo =sysDeptService.selectDeptById(sysUserVo.getDeptId());
|
||||
if (sysDeptVo != null) {
|
||||
String[] split = sysDeptVo.getAncestors().split(",");
|
||||
if (split.length > 0) {
|
||||
//当祖级列表长度大于3时取第2个作为公司id
|
||||
if (split.length > 1) {
|
||||
add.setCompanyId(Long.parseLong(split[1]));
|
||||
}else {
|
||||
add.setCompanyId(Long.parseLong(split[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusComplaintBoxBo bo) {
|
||||
BusComplaintBox update = MapstructUtils.convert(bo, BusComplaintBox.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusComplaintBox entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* app获取当前用户提出意见列表
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxVo> appQueryPageList(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
Page<BusComplaintBoxVo> result = baseMapper.selectVoPageList(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* app获取当前意见详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppDetailsOfTheOpinionVo appQueryById(Long id) {
|
||||
AppDetailsOfTheOpinionVo vo = new AppDetailsOfTheOpinionVo();
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(id);
|
||||
if(busComplaintBoxVo == null){
|
||||
throw new ServiceException("找不到意见信息!!!");
|
||||
}
|
||||
if (busComplaintBoxVo.getAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(busComplaintBoxVo.getAvatar());
|
||||
if (ossVo != null){
|
||||
busComplaintBoxVo.setAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
if (busComplaintBoxVo.getFileId() != null){
|
||||
String[] split = busComplaintBoxVo.getFileId().split(",");
|
||||
List<Long> fileIds = Arrays.stream(split)
|
||||
.filter(str -> str != null && !str.trim().isEmpty()) // 过滤空值和空白字符串
|
||||
.map(str -> {
|
||||
try {
|
||||
return Long.valueOf(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
// 转换失败时可返回null,后续再过滤
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Objects::nonNull) // 过滤转换失败的null值
|
||||
.toList();
|
||||
List<SysOssVo> sysOssVos = sysOssService.listByIds(fileIds);
|
||||
List<String> urls = new ArrayList<>();
|
||||
sysOssVos.forEach(sysOssVo -> {
|
||||
if (sysOssVo != null){
|
||||
urls.add(sysOssVo.getUrl());
|
||||
}
|
||||
});
|
||||
busComplaintBoxVo.setFileUrls(urls);
|
||||
}
|
||||
vo.setBusComplaintBoxVo(busComplaintBoxVo);
|
||||
List<BusComplaintBoxMessageLoggingVo> messageLoggingVos = messageLoggingMapper.selectVoList(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>().eq(BusComplaintBoxMessageLogging::getComplaintId, id));
|
||||
if(CollectionUtils.isNotEmpty(messageLoggingVos)){
|
||||
messageLoggingVos.forEach(mvo->{
|
||||
if (mvo.getReplyAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(mvo.getReplyAvatar());
|
||||
if (ossVo != null){
|
||||
mvo.setReplyAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
if (mvo.getRepliedAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(mvo.getRepliedAvatar());
|
||||
if (ossVo != null){
|
||||
mvo.setRepliedAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
});
|
||||
vo.setMessageLoggingVos(messageLoggingVos);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailsOfTheOpinionVo getInfo(Long id) {
|
||||
DetailsOfTheOpinionVo vo = new DetailsOfTheOpinionVo();
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(id);
|
||||
if(busComplaintBoxVo == null){
|
||||
throw new ServiceException("找不到意见信息!!!");
|
||||
}
|
||||
vo.setBusComplaintBoxVo(busComplaintBoxVo);
|
||||
List<BusComplaintBoxMessageLoggingVo> messageLoggingVos = messageLoggingMapper.selectVoList(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>().eq(BusComplaintBoxMessageLogging::getComplaintId, id));
|
||||
if(CollectionUtils.isNotEmpty(messageLoggingVos)){
|
||||
messageLoggingVos.forEach(messageLoggingVo->{
|
||||
messageLoggingVo.setType(messageLoggingVo.getReplyUserId().equals(busComplaintBoxVo.getUserId()) ? 0 : 1);
|
||||
if (messageLoggingVo.getReplyAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(messageLoggingVo.getReplyAvatar());
|
||||
if (ossVo != null){
|
||||
messageLoggingVo.setReplyAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
if (messageLoggingVo.getRepliedAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(messageLoggingVo.getRepliedAvatar());
|
||||
if (ossVo != null){
|
||||
messageLoggingVo.setRepliedAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
});
|
||||
vo.setMessageLoggingVos(messageLoggingVos);
|
||||
}
|
||||
return vo;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* app修改沟通记录阅读状态
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int editCheckStatus(BusComplaintBoxBo bo) {
|
||||
if (bo.getId() == null || bo.getUserId() == null) {
|
||||
return 1;
|
||||
}
|
||||
Long count = messageLoggingMapper.selectCount(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>()
|
||||
.eq(BusComplaintBoxMessageLogging::getStatus,"0")
|
||||
.eq(BusComplaintBoxMessageLogging::getComplaintId, bo.getId())
|
||||
.eq(BusComplaintBoxMessageLogging::getRepliedUserId, bo.getUserId()));
|
||||
if (count == 0) {
|
||||
return 1;
|
||||
}
|
||||
return messageLoggingMapper.update(new LambdaUpdateWrapper<BusComplaintBoxMessageLogging>()
|
||||
.set(BusComplaintBoxMessageLogging::getStatus,"1")
|
||||
.eq(BusComplaintBoxMessageLogging::getComplaintId,bo.getId())
|
||||
.eq(BusComplaintBoxMessageLogging::getRepliedUserId,bo.getUserId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComplaintBoxCountVo> getCount(BusComplaintBoxBo bo) {
|
||||
|
||||
return baseMapper.getCount(bo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int editStatus(BusComplaintBoxBo bo) {
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(bo.getId());
|
||||
if (busComplaintBoxVo == null){
|
||||
throw new ServiceException("找不到意见!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBoxVo.getStatus())){
|
||||
throw new ServiceException("该意见已经关闭,不允许再修改状态");
|
||||
}
|
||||
return baseMapper.update(new LambdaUpdateWrapper<BusComplaintBox>().set(BusComplaintBox::getStatus,bo.getStatus()).eq(BusComplaintBox::getId, bo.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.complaintBox.mapper.BusComplaintBoxDisposeLoggingMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,82 @@
|
||||
<?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="org.dromara.complaintBox.mapper.BusComplaintBoxMapper">
|
||||
|
||||
|
||||
<select id="selectVoPageList" resultType="org.dromara.complaintBox.domain.vo.BusComplaintBoxVo">
|
||||
SELECT bcb.*,
|
||||
bcml.unread_count AS count
|
||||
FROM bus_complaint_box bcb
|
||||
LEFT JOIN (SELECT complaint_id, COUNT(*) AS unread_count
|
||||
FROM bus_complaint_box_message_logging
|
||||
WHERE STATUS = '0'
|
||||
GROUP BY complaint_id) bcml ON bcb.id = bcml.complaint_id
|
||||
<where>
|
||||
(bcb.user_id = #{bo.userId})
|
||||
<if test="bo.opinionType != null and bo.opinionType != '' ">
|
||||
AND bcb.opinion_type = #{bo.opinionType}
|
||||
</if>
|
||||
<if test="bo.status != null and bo.status != '' ">
|
||||
AND bcb.status = #{bo.status}
|
||||
</if>
|
||||
<if test="bo.title != null and bo.title != '' ">
|
||||
AND bcb.title LIKE CONCAT('%', #{bo.title}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY bcb.create_time DESC
|
||||
</select>
|
||||
<select id="selectVoPageWebList" resultType="org.dromara.complaintBox.domain.vo.BusComplaintBoxVo">
|
||||
SELECT bcb.*,
|
||||
bcml.unread_count AS count
|
||||
FROM bus_complaint_box bcb
|
||||
LEFT JOIN (SELECT complaint_id, COUNT(*) AS unread_count
|
||||
FROM bus_complaint_box_message_logging
|
||||
WHERE STATUS = '0'
|
||||
GROUP BY complaint_id) bcml ON bcb.id = bcml.complaint_id
|
||||
<where>
|
||||
(bcb.current_dispose_user_id is null or bcb.current_dispose_user_id = #{bo.currentDisposeUserId})
|
||||
<if test="bo.companyId != null">
|
||||
AND bcb.company_id = #{bo.companyId}
|
||||
</if>
|
||||
<if test="bo.projectId != null">
|
||||
AND bcb.project_id = #{bo.projectId}
|
||||
</if>
|
||||
<if test="bo.opinionType != null and bo.opinionType != '' ">
|
||||
AND bcb.opinion_type = #{bo.opinionType}
|
||||
</if>
|
||||
<if test="bo.status != null and bo.status != '' ">
|
||||
AND bcb.status = #{bo.status}
|
||||
</if>
|
||||
<if test="bo.title != null and bo.title != '' ">
|
||||
AND bcb.title LIKE CONCAT('%', #{bo.title}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY bcb.create_time DESC
|
||||
</select>
|
||||
<select id="getCount" resultType="org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo">
|
||||
SELECT
|
||||
d.dict_value AS type, -- 字典中的STATUS值
|
||||
d.dict_label AS typeName, -- 可选:STATUS对应的名称(如“待处理”)
|
||||
COUNT(bcb.id) AS count -- 无数据时count=0
|
||||
FROM
|
||||
-- 步骤1:从字典表筛选出投诉状态的所有有效值(基准表)
|
||||
(SELECT DISTINCT dict_value,dict_label
|
||||
FROM sys_dict_data
|
||||
WHERE dict_type = 'opinion_processing_status') d -- 假设字典表有启用状态筛选(可选)
|
||||
LEFT JOIN
|
||||
-- 步骤2:左连接业务表,关联STATUS
|
||||
(SELECT * FROM bus_complaint_box
|
||||
<where>
|
||||
<if test="bo.companyId != null">
|
||||
AND company_id = #{bo.companyId}
|
||||
</if>
|
||||
<if test="bo.projectId != null">
|
||||
AND project_id = #{bo.projectId}
|
||||
</if>
|
||||
</where>) bcb ON d.dict_value = bcb.STATUS
|
||||
GROUP BY
|
||||
d.dict_value, d.dict_label -- 按字典值+标签分组(确保全量显示)
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.complaintBox.mapper.BusComplaintBoxMessageLoggingMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user