forked from 15166072824/NO6
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTongzhifasongController.java
More file actions
134 lines (111 loc) · 5.22 KB
/
TongzhifasongController.java
File metadata and controls
134 lines (111 loc) · 5.22 KB
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
126
127
128
129
130
131
132
133
134
package com.cl.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import com.cl.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.cl.annotation.IgnoreAuth;
import com.cl.annotation.SysLog;
import com.cl.entity.TongzhifasongEntity;
import com.cl.entity.view.TongzhifasongView;
import com.cl.service.TongzhifasongService;
import com.cl.service.TokenService;
import com.cl.utils.PageUtils;
import com.cl.utils.R;
import com.cl.utils.MPUtil;
import com.cl.utils.MapUtils;
import com.cl.utils.CommonUtil;
@RestController
@RequestMapping("/tongzhifasong")
public class TongzhifasongController {
@Autowired
private TongzhifasongService tongzhifasongService;
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,TongzhifasongEntity tongzhifasong,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
EntityWrapper<TongzhifasongEntity> ew = new EntityWrapper<TongzhifasongEntity>();
PageUtils page = tongzhifasongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tongzhifasong), params), params));
return R.ok().put("data", page);
}
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,TongzhifasongEntity tongzhifasong,
HttpServletRequest request){
EntityWrapper<TongzhifasongEntity> ew = new EntityWrapper<TongzhifasongEntity>();
PageUtils page = tongzhifasongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tongzhifasong), params), params));
return R.ok().put("data", page);
}
@RequestMapping("/lists")
public R list( TongzhifasongEntity tongzhifasong){
EntityWrapper<TongzhifasongEntity> ew = new EntityWrapper<TongzhifasongEntity>();
ew.allEq(MPUtil.allEQMapPre( tongzhifasong, "tongzhifasong"));
return R.ok().put("data", tongzhifasongService.selectListView(ew));
}
@RequestMapping("/query")
public R query(TongzhifasongEntity tongzhifasong){
EntityWrapper< TongzhifasongEntity> ew = new EntityWrapper< TongzhifasongEntity>();
ew.allEq(MPUtil.allEQMapPre( tongzhifasong, "tongzhifasong"));
TongzhifasongView tongzhifasongView = tongzhifasongService.selectView(ew);
return R.ok("查询通知发送记录成功").put("data", tongzhifasongView);
}
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
TongzhifasongEntity tongzhifasong = tongzhifasongService.selectById(id);
tongzhifasong = tongzhifasongService.selectView(new EntityWrapper<TongzhifasongEntity>().eq("id", id));
return R.ok().put("data", tongzhifasong);
}
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
TongzhifasongEntity tongzhifasong = tongzhifasongService.selectById(id);
tongzhifasong = tongzhifasongService.selectView(new EntityWrapper<TongzhifasongEntity>().eq("id", id));
return R.ok().put("data", tongzhifasong);
}
@RequestMapping("/save")
@SysLog("新增通知发送记录")
public R save(@RequestBody TongzhifasongEntity tongzhifasong, HttpServletRequest request){
tongzhifasongService.insert(tongzhifasong);
return R.ok();
}
@SysLog("新增通知发送记录")
@RequestMapping("/add")
public R add(@RequestBody TongzhifasongEntity tongzhifasong, HttpServletRequest request){
tongzhifasongService.insert(tongzhifasong);
return R.ok();
}
@RequestMapping("/update")
@Transactional
@SysLog("修改通知发送记录")
public R update(@RequestBody TongzhifasongEntity tongzhifasong, HttpServletRequest request){
tongzhifasongService.updateById(tongzhifasong);
return R.ok();
}
@RequestMapping("/delete")
@SysLog("删除通知发送记录")
public R delete(@RequestBody Long[] ids){
tongzhifasongService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
@RequestMapping("/retry")
@SysLog("重试发送通知")
public R retry(HttpServletRequest request){
tongzhifasongService.retryFailedNotifications();
return R.ok("重试完成");
}
}