瀏覽代碼

* 新需求提交

顾绍勇 5 年之前
父節點
當前提交
b71898871d

+ 1
- 8
src/main/java/com/huiju/estateagents/sample/controller/TaContactController.java 查看文件

12
 import org.slf4j.Logger;
12
 import org.slf4j.Logger;
13
 import org.slf4j.LoggerFactory;
13
 import org.slf4j.LoggerFactory;
14
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.PathVariable;
16
-import org.springframework.web.bind.annotation.RequestBody;
17
-import org.springframework.web.bind.annotation.RequestMapping;
18
-import org.springframework.web.bind.annotation.RequestMethod;
19
-import org.springframework.web.bind.annotation.RequestParam;
20
-import org.springframework.web.bind.annotation.ResponseBody;
21
-import org.springframework.web.bind.annotation.RestController;
15
+import org.springframework.web.bind.annotation.*;
22
 
16
 
23
 import java.time.LocalDateTime;
17
 import java.time.LocalDateTime;
24
 import java.util.ArrayList;
18
 import java.util.ArrayList;
122
                 newContact.setStatus(CommConstant.STATUS_DELETE);
116
                 newContact.setStatus(CommConstant.STATUS_DELETE);
123
                 updateList.add(newContact);
117
                 updateList.add(newContact);
124
             }
118
             }
125
-
126
             responseBean.addSuccess(iTaContactService.updateBatchById(updateList));
119
             responseBean.addSuccess(iTaContactService.updateBatchById(updateList));
127
         } catch (Exception e) {
120
         } catch (Exception e) {
128
             e.printStackTrace();
121
             e.printStackTrace();

+ 22
- 16
src/main/java/com/huiju/estateagents/sample/controller/TaNoticeController.java 查看文件

1
 package com.huiju.estateagents.sample.controller;
1
 package com.huiju.estateagents.sample.controller;
2
 
2
 
3
 import com.alibaba.fastjson.JSONObject;
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
 import com.huiju.estateagents.base.BaseController;
4
 import com.huiju.estateagents.base.BaseController;
8
 import com.huiju.estateagents.base.ResponseBean;
5
 import com.huiju.estateagents.base.ResponseBean;
6
+import com.huiju.estateagents.sample.entity.TaH5Sample;
9
 import com.huiju.estateagents.sample.entity.TaNotice;
7
 import com.huiju.estateagents.sample.entity.TaNotice;
8
+import com.huiju.estateagents.sample.service.ITaH5SampleService;
10
 import com.huiju.estateagents.sample.service.ITaNoticeService;
9
 import com.huiju.estateagents.sample.service.ITaNoticeService;
11
 import org.slf4j.Logger;
10
 import org.slf4j.Logger;
12
 import org.slf4j.LoggerFactory;
11
 import org.slf4j.LoggerFactory;
13
 import org.springframework.beans.factory.annotation.Autowired;
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
 import java.time.LocalDateTime;
15
 import java.time.LocalDateTime;
24
 import java.util.List;
16
 import java.util.List;
25
 
17
 
40
     @Autowired
32
     @Autowired
41
     public ITaNoticeService iTaNoticeService;
33
     public ITaNoticeService iTaNoticeService;
42
 
34
 
35
+    @Autowired
36
+    public ITaH5SampleService iTaH5SampleService;
37
+
43
     /**
38
     /**
44
      * 条件查询通知列表
39
      * 条件查询通知列表
45
      *
40
      *
49
      * @param targetType
44
      * @param targetType
50
      * @param targetName
45
      * @param targetName
51
      * @param status
46
      * @param status
52
-     * @param type       类型
47
+     * @param type       类型 目前默认 sample
53
      * @return
48
      * @return
54
      */
49
      */
55
     @RequestMapping(value = "/channel/listNoticeByCondition", method = RequestMethod.GET)
50
     @RequestMapping(value = "/channel/listNoticeByCondition", method = RequestMethod.GET)
147
     public ResponseBean taNoticeGet(@PathVariable Integer id) {
142
     public ResponseBean taNoticeGet(@PathVariable Integer id) {
148
         ResponseBean responseBean = new ResponseBean();
143
         ResponseBean responseBean = new ResponseBean();
149
         try {
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
         } catch (Exception e) {
157
         } catch (Exception e) {
152
             e.printStackTrace();
158
             e.printStackTrace();
153
             logger.error("taNoticeDelete -=- {}", e.toString());
159
             logger.error("taNoticeDelete -=- {}", e.toString());
161
      *
167
      *
162
      * @param pageNum
168
      * @param pageNum
163
      * @param pageSize
169
      * @param pageSize
164
-     * @param type       类型 目前默认 sample
170
+     * @param type     类型 目前默认 sample
165
      * @return
171
      * @return
166
      */
172
      */
167
     @RequestMapping(value = "/admin/listNoticeByCondition", method = RequestMethod.GET)
173
     @RequestMapping(value = "/admin/listNoticeByCondition", method = RequestMethod.GET)
168
     public ResponseBean listNoticeByConditionForAdmin(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
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
         ResponseBean responseBean = new ResponseBean();
177
         ResponseBean responseBean = new ResponseBean();
172
         try {
178
         try {
173
             responseBean = iTaNoticeService.listNoticeByConditionForAdmin(pageNum, pageSize, type);
179
             responseBean = iTaNoticeService.listNoticeByConditionForAdmin(pageNum, pageSize, type);

+ 5
- 4
src/main/resources/mapper/sample/TaNoticeMapper.xml 查看文件

34
         FROM
34
         FROM
35
             ta_notice t
35
             ta_notice t
36
             LEFT JOIN ta_h5_sample t2 ON t.target_id = t2.sample_id
36
             LEFT JOIN ta_h5_sample t2 ON t.target_id = t2.sample_id
37
-        where
38
-            t.`status` == 1
39
-            AND t.invalid_time >= NOW( )
37
+        WHERE
38
+            t.`status` = 1
39
+            AND t.invalid_time >= NOW( )
40
         ORDER BY
40
         ORDER BY
41
-            t.order_no DESC,t.create_date DESC
41
+            t.order_no DESC,
42
+            t.create_date DESC
42
     </select>
43
     </select>
43
 </mapper>
44
 </mapper>