意见箱修改
This commit is contained in:
@ -3,10 +3,14 @@ package org.dromara.complaintBox.controller;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxDisposeLoggingBo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxDisposeLoggingService;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -37,10 +41,13 @@ import java.util.List;
|
||||
@RequestMapping("/complaintBox/complaintBox")
|
||||
public class BusComplaintBoxController extends BaseController {
|
||||
|
||||
@Lazy
|
||||
private final IBusComplaintBoxService busComplaintBoxService;
|
||||
@Lazy
|
||||
private final IBusComplaintBoxMessageLoggingService busComplaintBoxMessageLoggingService;
|
||||
@Autowired
|
||||
private IBusComplaintBoxMessageLoggingService busComplaintBoxMessageLoggingService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IBusComplaintBoxDisposeLoggingService disposeLoggingService;
|
||||
|
||||
|
||||
/**
|
||||
@ -51,6 +58,14 @@ public class BusComplaintBoxController extends BaseController {
|
||||
public TableDataInfo<BusComplaintBoxVo> list(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
return busComplaintBoxService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 查询意见处理记录列表
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:list")
|
||||
@GetMapping("/getDisposeLogList")
|
||||
public TableDataInfo<BusComplaintBoxDisposeLoggingVo> getDisposeLogList(BusComplaintBoxDisposeLoggingBo bo, PageQuery pageQuery) {
|
||||
return disposeLoggingService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* web获取各个处理状态数量
|
||||
*/
|
||||
|
||||
@ -78,7 +78,7 @@ public class BusComplaintBox extends BaseEntity {
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,10、退回,14、关闭)
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,10、退回,14、不予解决())
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -86,5 +86,10 @@ public class BusComplaintBoxBo extends BaseEntity {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
@ -71,5 +73,10 @@ public class BusComplaintBoxDisposeLoggingVo implements Serializable {
|
||||
@ExcelProperty(value = "退回原因")
|
||||
private String cause;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -72,13 +72,11 @@ public class BusComplaintBoxDisposeLoggingServiceImpl extends ServiceImpl<BusCom
|
||||
private LambdaQueryWrapper<BusComplaintBoxDisposeLogging> buildQueryWrapper(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBoxDisposeLogging::getId);
|
||||
lqw.orderByDesc(BusComplaintBoxDisposeLogging::getCreateTime);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@ -109,7 +109,7 @@ public class BusComplaintBoxMessageLoggingServiceImpl extends ServiceImpl<BusCom
|
||||
if (busComplaintBox == null) {
|
||||
throw new ServiceException("意见信息找不到!!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus())){
|
||||
if ("14".equals(busComplaintBox.getStatus()) || "9".equals(busComplaintBox.getStatus())) {
|
||||
throw new ServiceException("意见已关闭!!!");
|
||||
}
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
@ -145,7 +145,13 @@ public class BusComplaintBoxMessageLoggingServiceImpl extends ServiceImpl<BusCom
|
||||
if (busComplaintBox == null) {
|
||||
throw new ServiceException("意见信息找不到!!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus())){
|
||||
if (busComplaintBox.getCurrentDisposeUserId()!= null && !loginUser.getUserId().equals(busComplaintBox.getCurrentDisposeUserId())) {
|
||||
throw new ServiceException("处理人异常");
|
||||
}
|
||||
if ("0".equals(busComplaintBox.getStatus())){
|
||||
throw new ServiceException("意见未处理,不能发布信息");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus()) || "9".equals(busComplaintBox.getStatus())) {
|
||||
throw new ServiceException("意见已关闭!!!");
|
||||
}
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
@ -159,11 +165,11 @@ public class BusComplaintBoxMessageLoggingServiceImpl extends ServiceImpl<BusCom
|
||||
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if ("0".equals(busComplaintBox.getStatus())){
|
||||
busComplaintBox.setStatus("5");
|
||||
busComplaintBox.setCurrentDisposeUserId(sysUserVo.getUserId());
|
||||
busComplaintBoxMapper.updateById(busComplaintBox);
|
||||
}
|
||||
// if ("0".equals(busComplaintBox.getStatus())){
|
||||
// busComplaintBox.setStatus("5");
|
||||
// busComplaintBox.setCurrentDisposeUserId(sysUserVo.getUserId());
|
||||
// busComplaintBoxMapper.updateById(busComplaintBox);
|
||||
// }
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ 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 jakarta.annotation.Resource;
|
||||
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;
|
||||
@ -12,12 +14,15 @@ 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.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
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.IBusComplaintBoxDisposeLoggingService;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.dromara.system.domain.vo.SysDeptVo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
@ -32,6 +37,7 @@ 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 org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -50,11 +56,17 @@ public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMappe
|
||||
// @Lazy
|
||||
private final BusComplaintBoxMessageLoggingMapper messageLoggingMapper;
|
||||
@Lazy
|
||||
private final ISysUserService sysUserService;
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
@Lazy
|
||||
private final ISysDeptService sysDeptService;
|
||||
@Resource
|
||||
private ISysDeptService sysDeptService;
|
||||
@Lazy
|
||||
private final ISysOssService sysOssService;
|
||||
@Resource
|
||||
private ISysOssService sysOssService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IBusComplaintBoxDisposeLoggingService disposeLoggingService;
|
||||
|
||||
/**
|
||||
* 查询意见箱
|
||||
@ -319,6 +331,7 @@ public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int editStatus(BusComplaintBoxBo bo) {
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(bo.getId());
|
||||
if (busComplaintBoxVo == null){
|
||||
@ -330,8 +343,32 @@ public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMappe
|
||||
LambdaUpdateWrapper<BusComplaintBox> lqw = new LambdaUpdateWrapper<BusComplaintBox>();
|
||||
lqw.set(BusComplaintBox::getStatus, bo.getStatus());
|
||||
lqw.eq(BusComplaintBox::getId, bo.getId());
|
||||
if ("5".equals(busComplaintBoxVo.getStatus())){
|
||||
BusComplaintBoxDisposeLogging logging = new BusComplaintBoxDisposeLogging();
|
||||
logging.setComplaintId(bo.getId());
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
if (sysUserVo == null){
|
||||
throw new ServiceException("找不到当前登录用户信息!");
|
||||
}
|
||||
logging.setUserId(loginUser.getUserId());
|
||||
logging.setUserName(sysUserVo.getNickName());
|
||||
logging.setAvatar(sysUserVo.getAvatar());
|
||||
disposeLoggingService.save(logging);
|
||||
}
|
||||
if ("0".equals(bo.getStatus())){
|
||||
lqw.set(BusComplaintBox::getCurrentDisposeUserId, null);
|
||||
BusComplaintBoxDisposeLogging logging = disposeLoggingService.getBaseMapper()
|
||||
.selectOne(new LambdaQueryWrapper<BusComplaintBoxDisposeLogging>()
|
||||
.eq(BusComplaintBoxDisposeLogging::getComplaintId, bo.getId())
|
||||
.eq(BusComplaintBoxDisposeLogging::getUserId, busComplaintBoxVo.getCurrentDisposeUserId())
|
||||
.eq(BusComplaintBoxDisposeLogging::getIsRefund, "0"));
|
||||
if (logging == null){
|
||||
throw new ServiceException("找不到处理人记录");
|
||||
}
|
||||
logging.setIsRefund("1");
|
||||
logging.setCause(bo.getCause());
|
||||
disposeLoggingService.updateById(logging);
|
||||
}
|
||||
return baseMapper.update(lqw);
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ public class OthYs7DeviceController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("other:ys7Device:list")
|
||||
@GetMapping("/getViolationRecordInfo/{id}")
|
||||
public R<HseViolationRecordVo> getViolationRecordInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(hseViolationRecordService.queryById(id));
|
||||
}
|
||||
// @SaCheckPermission("other:ys7Device:list")
|
||||
// @GetMapping("/getViolationRecordInfo/{id}")
|
||||
// public R<HseViolationRecordVo> getViolationRecordInfo(@NotNull(message = "主键不能为空")
|
||||
// @PathVariable Long id) {
|
||||
// return R.ok(hseViolationRecordService.queryById(id));
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@ -84,27 +84,27 @@ public class OthYs7DeviceController extends BaseController {
|
||||
@Log(title = "萤石摄像头图片", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/capture")
|
||||
public R<Void> capture(@RequestBody OthYs7DeviceImgCaptureReq req) {
|
||||
return toAjax(othYs7DeviceImgService.addHMCapturePic(req));
|
||||
return toAjax(othYs7DeviceImgService.capturePic(req));
|
||||
}
|
||||
/**
|
||||
* 萤石摄像头图片识别
|
||||
*/
|
||||
@SaCheckPermission("other:ys7Device:list")
|
||||
@Log(title = "萤石摄像头图片", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/discernImg")
|
||||
public R<Void> discernImg(@RequestBody OthYs7DeviceImgCaptureReq req) {
|
||||
return toAjax(othYs7DeviceImgService.discernImg(req));
|
||||
}
|
||||
// @SaCheckPermission("other:ys7Device:list")
|
||||
// @Log(title = "萤石摄像头图片", businessType = BusinessType.INSERT)
|
||||
// @PostMapping("/discernImg")
|
||||
// public R<Void> discernImg(@RequestBody OthYs7DeviceImgCaptureReq req) {
|
||||
// return toAjax(othYs7DeviceImgService.discernImg(req));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 下发工单
|
||||
*/
|
||||
@SaCheckPermission("other:ys7Device:list")
|
||||
@Log(title = "萤石摄像头图片", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addViolationRecord")
|
||||
public R<Void> addViolationRecord(@RequestBody AddViolattionRecordReq req) {
|
||||
return toAjax(othYs7DeviceImgService.addViolationRecord(req));
|
||||
}
|
||||
// @SaCheckPermission("other:ys7Device:list")
|
||||
// @Log(title = "萤石摄像头图片", businessType = BusinessType.INSERT)
|
||||
// @PostMapping("/addViolationRecord")
|
||||
// public R<Void> addViolationRecord(@RequestBody AddViolattionRecordReq req) {
|
||||
// return toAjax(othYs7DeviceImgService.addViolationRecord(req));
|
||||
// }
|
||||
/**
|
||||
* 查询萤石摄像头图片列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user