|
@@ -1,25 +1,17 @@
|
1
|
1
|
package com.huiju.estateagents.sample.controller;
|
2
|
2
|
|
3
|
3
|
import com.alibaba.fastjson.JSONObject;
|
4
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
6
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
7
|
4
|
import com.huiju.estateagents.base.BaseController;
|
8
|
5
|
import com.huiju.estateagents.base.ResponseBean;
|
|
6
|
+import com.huiju.estateagents.sample.entity.TaH5Sample;
|
9
|
7
|
import com.huiju.estateagents.sample.entity.TaNotice;
|
|
8
|
+import com.huiju.estateagents.sample.service.ITaH5SampleService;
|
10
|
9
|
import com.huiju.estateagents.sample.service.ITaNoticeService;
|
11
|
10
|
import org.slf4j.Logger;
|
12
|
11
|
import org.slf4j.LoggerFactory;
|
13
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
14
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
15
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
16
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
17
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
18
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
19
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
20
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
13
|
+import org.springframework.web.bind.annotation.*;
|
21
|
14
|
|
22
|
|
-import javax.servlet.http.HttpServletRequest;
|
23
|
15
|
import java.time.LocalDateTime;
|
24
|
16
|
import java.util.List;
|
25
|
17
|
|
|
@@ -40,6 +32,9 @@ public class TaNoticeController extends BaseController {
|
40
|
32
|
@Autowired
|
41
|
33
|
public ITaNoticeService iTaNoticeService;
|
42
|
34
|
|
|
35
|
+ @Autowired
|
|
36
|
+ public ITaH5SampleService iTaH5SampleService;
|
|
37
|
+
|
43
|
38
|
/**
|
44
|
39
|
* 条件查询通知列表
|
45
|
40
|
*
|
|
@@ -49,7 +44,7 @@ public class TaNoticeController extends BaseController {
|
49
|
44
|
* @param targetType
|
50
|
45
|
* @param targetName
|
51
|
46
|
* @param status
|
52
|
|
- * @param type 类型
|
|
47
|
+ * @param type 类型 目前默认 sample
|
53
|
48
|
* @return
|
54
|
49
|
*/
|
55
|
50
|
@RequestMapping(value = "/channel/listNoticeByCondition", method = RequestMethod.GET)
|
|
@@ -147,7 +142,18 @@ public class TaNoticeController extends BaseController {
|
147
|
142
|
public ResponseBean taNoticeGet(@PathVariable Integer id) {
|
148
|
143
|
ResponseBean responseBean = new ResponseBean();
|
149
|
144
|
try {
|
150
|
|
- responseBean.addSuccess(iTaNoticeService.getById(id));
|
|
145
|
+ TaNotice taNotice = iTaNoticeService.getById(id);
|
|
146
|
+ if (taNotice == null) {
|
|
147
|
+ responseBean.addError("fail");
|
|
148
|
+ return responseBean;
|
|
149
|
+ }
|
|
150
|
+ if (taNotice.getTargetId() != null) {
|
|
151
|
+ TaH5Sample taH5Sample = iTaH5SampleService.getById(taNotice.getNoticeId());
|
|
152
|
+ if(taH5Sample != null){
|
|
153
|
+ taNotice.setTargetName(taH5Sample.getSampleName());
|
|
154
|
+ }
|
|
155
|
+ }
|
|
156
|
+ responseBean.addSuccess(taNotice);
|
151
|
157
|
} catch (Exception e) {
|
152
|
158
|
e.printStackTrace();
|
153
|
159
|
logger.error("taNoticeDelete -=- {}", e.toString());
|
|
@@ -161,13 +167,13 @@ public class TaNoticeController extends BaseController {
|
161
|
167
|
*
|
162
|
168
|
* @param pageNum
|
163
|
169
|
* @param pageSize
|
164
|
|
- * @param type 类型 目前默认 sample
|
|
170
|
+ * @param type 类型 目前默认 sample
|
165
|
171
|
* @return
|
166
|
172
|
*/
|
167
|
173
|
@RequestMapping(value = "/admin/listNoticeByCondition", method = RequestMethod.GET)
|
168
|
174
|
public ResponseBean listNoticeByConditionForAdmin(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
169
|
|
- @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
170
|
|
- String type) {
|
|
175
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
176
|
+ String type) {
|
171
|
177
|
ResponseBean responseBean = new ResponseBean();
|
172
|
178
|
try {
|
173
|
179
|
responseBean = iTaNoticeService.listNoticeByConditionForAdmin(pageNum, pageSize, type);
|