44323
2024-04-23 16b704d18a875d1fb63827aaa507790ba2bef5be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package com.stylefeng.guns.modular.code.controller;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.stylefeng.guns.core.base.tips.ErrorTip;
import com.stylefeng.guns.core.common.annotion.BussinessLog;
import com.stylefeng.guns.core.common.constant.Const;
import com.stylefeng.guns.core.common.constant.dictmap.UserDict;
import com.stylefeng.guns.core.common.constant.state.ManagerStatus;
import com.stylefeng.guns.core.common.exception.BizExceptionEnum;
import com.stylefeng.guns.core.exception.GunsException;
import com.stylefeng.guns.core.log.LogManager;
import com.stylefeng.guns.core.log.factory.LogTaskFactory;
import com.stylefeng.guns.core.mutidatasource.annotion.DataSource;
import com.stylefeng.guns.core.node.ZTreeNode;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.shiro.ShiroUser;
import com.stylefeng.guns.core.support.HttpKit;
import com.stylefeng.guns.core.util.HttpUtils;
import com.stylefeng.guns.core.util.JwtTokenUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.UserMapper;
import com.stylefeng.guns.modular.system.dto.FeedbackQuery;
import com.stylefeng.guns.modular.system.dto.TreeBean;
import com.stylefeng.guns.modular.system.factory.UserFactory;
import com.stylefeng.guns.modular.system.model.Banner;
import com.stylefeng.guns.modular.system.model.Feedback;
import com.stylefeng.guns.modular.system.model.User;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.transfer.UserDto;
import com.stylefeng.guns.modular.system.util.ListToTreeUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.vo.CouponListVO;
import com.stylefeng.guns.modular.system.vo.FeedbackVO;
import com.stylefeng.guns.modular.system.warpper.res.DistrictRes;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.ByteSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
 
import javax.naming.NoPermissionException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.*;
 
import static com.stylefeng.guns.core.support.HttpKit.getIp;
 
@Controller
@RequestMapping("/base/feedback")
public class FeedbackController {
    protected HttpServletResponse getHttpServletResponse() {
        return HttpKit.getResponse();
    }
    protected HttpServletRequest getHttpServletRequest() {
        return HttpKit.getRequest();
    }
    @Autowired
    private IUserService userService;
    @Autowired
    private IBannerService bannerService;
    @Autowired
    private ISysDataTypeService typeService;
    @Autowired
    private IMenuService menuService;
    @Autowired
    private IRegionService regionService;
    @Autowired
    private IFeedbackService feedbackService;
 
    @ResponseBody
    @GetMapping("/listAll")
    @ApiOperation(value = "列表查询", tags = {"反馈管理"})
 
    public ResultUtil<PageInfo<FeedbackVO>> listAll(FeedbackQuery query){
        if (query.getEndTime()!=null){
            query.getEndTime().setHours(23);
            query.getEndTime().setMinutes(59);
            query.getEndTime().setSeconds(59);
        }
        List<FeedbackVO> res = feedbackService.listAll(query);
//        PageHelper.startPage(query.getPageNum(),query.getPageSize());
        PageInfo<FeedbackVO> info=new PageInfo<>(res);
        return ResultUtil.success(info);
    }
 
    @ResponseBody
    @GetMapping("/detail")
    @ApiOperation(value = "查看详情", tags = {"反馈管理"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "反馈id", name = "id"),
    })
    public ResultUtil<Feedback> detail(Integer id){
        Feedback feedback = feedbackService.selectById(id);
        return ResultUtil.success(feedback);
    }
 
    @ResponseBody
    @GetMapping("/handle")
    @ApiOperation(value = "处理", tags = {"反馈管理"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "反馈id", name = "id"),
    })
    public ResultUtil handle(Integer id){
        Feedback feedback = feedbackService.selectById(id);
        feedback.setState(2);
        feedbackService.updateById(feedback);
        return ResultUtil.success();
    }
 
}