问题反馈模块初始化
This commit is contained in:
parent
7bd60d5fea
commit
62b8ecade7
@ -0,0 +1,105 @@
|
|||||||
|
package com.djhk.uav.feedback.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.djhk.common.annotation.Log;
|
||||||
|
import com.djhk.common.core.controller.BaseController;
|
||||||
|
import com.djhk.common.core.domain.AjaxResult;
|
||||||
|
import com.djhk.common.core.domain.entity.SysUser;
|
||||||
|
import com.djhk.common.core.page.TableDataInfo;
|
||||||
|
import com.djhk.common.enums.BusinessType;
|
||||||
|
import com.djhk.common.utils.SecurityUtils;
|
||||||
|
import com.djhk.common.utils.poi.ExcelUtil;
|
||||||
|
import com.djhk.system.service.ISysUserService;
|
||||||
|
import com.djhk.uav.feedback.domain.QuestionFeedback;
|
||||||
|
import com.djhk.uav.feedback.service.IQuestionFeedbackService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.djhk.common.utils.PageUtils.startPage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题反馈Controller
|
||||||
|
*
|
||||||
|
* @author qpc
|
||||||
|
* @date 2025-04-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/feedback")
|
||||||
|
public class QuestionFeedbackController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IQuestionFeedbackService questionFeedbackService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询问题反馈列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<QuestionFeedback> list = questionFeedbackService.selectQuestionFeedbackList(questionFeedback);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出问题反馈列表
|
||||||
|
*/
|
||||||
|
@Log(title = "问题反馈", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
List<QuestionFeedback> list = questionFeedbackService.selectQuestionFeedbackList(questionFeedback);
|
||||||
|
ExcelUtil<QuestionFeedback> util = new ExcelUtil<QuestionFeedback>(QuestionFeedback.class);
|
||||||
|
util.exportExcel(response, list, "问题反馈数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取问题反馈详细信息
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
|
||||||
|
return AjaxResult.success(questionFeedbackService.selectQuestionFeedbackById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增问题反馈
|
||||||
|
*/
|
||||||
|
@Log(title = "问题反馈", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
// SysUser sysUser = userService.getUserInfoByUserId(SecurityUtils.getUserId(), SecurityConstants.INNER).getData();
|
||||||
|
SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
|
||||||
|
questionFeedback.setDeptId(sysUser.getDeptId().toString());
|
||||||
|
return toAjax(questionFeedbackService.insertQuestionFeedback(questionFeedback));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改问题反馈
|
||||||
|
*/
|
||||||
|
@Log(title = "问题反馈", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
return toAjax(questionFeedbackService.updateQuestionFeedback(questionFeedback));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除问题反馈
|
||||||
|
*/
|
||||||
|
@Log(title = "问题反馈", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(questionFeedbackService.deleteQuestionFeedbackByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.djhk.uav.feedback.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import com.djhk.common.annotation.Excel;
|
||||||
|
import com.djhk.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题反馈对象 question_feedback
|
||||||
|
*
|
||||||
|
* @author qpc
|
||||||
|
* @date 2025-04-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QuestionFeedback extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 标题 */
|
||||||
|
@Excel(name = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/** 图片 */
|
||||||
|
@Excel(name = "图片")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/** 描述 */
|
||||||
|
@Excel(name = "描述")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/** 电话 */
|
||||||
|
@Excel(name = "电话")
|
||||||
|
private String tel;
|
||||||
|
|
||||||
|
/** 部门 */
|
||||||
|
@Excel(name = "部门")
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.djhk.uav.feedback.mapper;
|
||||||
|
|
||||||
|
import com.djhk.uav.feedback.domain.QuestionFeedback;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题反馈Mapper接口
|
||||||
|
*
|
||||||
|
* @author qpc
|
||||||
|
* @date 2025-04-10
|
||||||
|
*/
|
||||||
|
public interface QuestionFeedbackMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询问题反馈
|
||||||
|
*
|
||||||
|
* @param id 问题反馈主键
|
||||||
|
* @return 问题反馈
|
||||||
|
*/
|
||||||
|
public QuestionFeedback selectQuestionFeedbackById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询问题反馈列表
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 问题反馈集合
|
||||||
|
*/
|
||||||
|
public List<QuestionFeedback> selectQuestionFeedbackList(QuestionFeedback questionFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增问题反馈
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertQuestionFeedback(QuestionFeedback questionFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改问题反馈
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateQuestionFeedback(QuestionFeedback questionFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除问题反馈
|
||||||
|
*
|
||||||
|
* @param id 问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteQuestionFeedbackById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除问题反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteQuestionFeedbackByIds(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.djhk.uav.feedback.service;
|
||||||
|
|
||||||
|
import com.djhk.uav.feedback.domain.QuestionFeedback;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题反馈Service接口
|
||||||
|
*
|
||||||
|
* @author qpc
|
||||||
|
* @date 2025-04-10
|
||||||
|
*/
|
||||||
|
public interface IQuestionFeedbackService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询问题反馈
|
||||||
|
*
|
||||||
|
* @param id 问题反馈主键
|
||||||
|
* @return 问题反馈
|
||||||
|
*/
|
||||||
|
public QuestionFeedback selectQuestionFeedbackById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询问题反馈列表
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 问题反馈集合
|
||||||
|
*/
|
||||||
|
public List<QuestionFeedback> selectQuestionFeedbackList(QuestionFeedback questionFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增问题反馈
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertQuestionFeedback(QuestionFeedback questionFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改问题反馈
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateQuestionFeedback(QuestionFeedback questionFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除问题反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的问题反馈主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteQuestionFeedbackByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除问题反馈信息
|
||||||
|
*
|
||||||
|
* @param id 问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteQuestionFeedbackById(Long id);
|
||||||
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
package com.djhk.uav.feedback.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.djhk.common.core.domain.entity.SysUser;
|
||||||
|
import com.djhk.common.utils.DateUtils;
|
||||||
|
import com.djhk.common.utils.SecurityUtils;
|
||||||
|
import com.djhk.system.service.ISysUserService;
|
||||||
|
import com.djhk.uav.feedback.domain.QuestionFeedback;
|
||||||
|
import com.djhk.uav.feedback.mapper.QuestionFeedbackMapper;
|
||||||
|
import com.djhk.uav.feedback.service.IQuestionFeedbackService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题反馈Service业务层处理
|
||||||
|
*
|
||||||
|
* @author qpc
|
||||||
|
* @date 2025-04-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class QuestionFeedbackServiceImpl implements IQuestionFeedbackService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private QuestionFeedbackMapper questionFeedbackMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询问题反馈
|
||||||
|
*
|
||||||
|
* @param id 问题反馈主键
|
||||||
|
* @return 问题反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QuestionFeedback selectQuestionFeedbackById(Long id)
|
||||||
|
{
|
||||||
|
return questionFeedbackMapper.selectQuestionFeedbackById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询问题反馈列表
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 问题反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<QuestionFeedback> selectQuestionFeedbackList(QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
|
||||||
|
Long deptId = sysUser.getDeptId();
|
||||||
|
if (deptId != 1)
|
||||||
|
{
|
||||||
|
questionFeedback.setDeptId(String.valueOf(deptId));
|
||||||
|
return questionFeedbackMapper.selectQuestionFeedbackList(questionFeedback);
|
||||||
|
}
|
||||||
|
return questionFeedbackMapper.selectQuestionFeedbackList(questionFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增问题反馈
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertQuestionFeedback(QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
// SysUser sysUser = userService.getUserInfoByUserId(SecurityUtils.getUserId(), SecurityConstants.INNER).getData();
|
||||||
|
SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
|
||||||
|
Long deptId = sysUser.getDeptId();
|
||||||
|
questionFeedback.setDeptId(String.valueOf(deptId));
|
||||||
|
questionFeedback.setCreateTime(DateUtils.getNowDate());
|
||||||
|
questionFeedback.setCreateBy(sysUser.getNickName());
|
||||||
|
return questionFeedbackMapper.insertQuestionFeedback(questionFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改问题反馈
|
||||||
|
*
|
||||||
|
* @param questionFeedback 问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateQuestionFeedback(QuestionFeedback questionFeedback)
|
||||||
|
{
|
||||||
|
// SysUser sysUser = userService.getUserInfoByUserId(SecurityUtils.getUserId(), SecurityConstants.INNER).getData();
|
||||||
|
SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
|
||||||
|
questionFeedback.setUpdateBy(sysUser.getNickName());
|
||||||
|
questionFeedback.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return questionFeedbackMapper.updateQuestionFeedback(questionFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除问题反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteQuestionFeedbackByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return questionFeedbackMapper.deleteQuestionFeedbackByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除问题反馈信息
|
||||||
|
*
|
||||||
|
* @param id 问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteQuestionFeedbackById(Long id)
|
||||||
|
{
|
||||||
|
return questionFeedbackMapper.deleteQuestionFeedbackById(id);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user