魏熙美 5 년 전
부모
커밋
c7d11ecb7e

+ 3
- 3
src/main/java/com/huiju/estateagents/common/CommConstant.java 파일 보기

118
     //=================  首屏广告 / 轮播图 start =======================
118
     //=================  首屏广告 / 轮播图 start =======================
119
 
119
 
120
     /**
120
     /**
121
-     * 首页轮播图类型_活动
121
+     * 首页 轮播图/广告 类型 ====  活动
122
      */
122
      */
123
     public static final String CAROUSEL_ACTIVITY = "activity";
123
     public static final String CAROUSEL_ACTIVITY = "activity";
124
 
124
 
125
     /**
125
     /**
126
-     * 首页 轮播图/广告 类型_项目
126
+     * 首页 轮播图/广告 类型 ==== 项目
127
      */
127
      */
128
     public static final String CAROUSEL_PROJECT = "project";
128
     public static final String CAROUSEL_PROJECT = "project";
129
 
129
 
130
     /**
130
     /**
131
-     * 首页轮播图类型_资讯
131
+     * 首页轮播图/广告 类型 ==== 资讯
132
      */
132
      */
133
     public static final String CAROUSEL_NEWS = "news";
133
     public static final String CAROUSEL_NEWS = "news";
134
 
134
 

+ 23
- 3
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java 파일 보기

6
 import com.huiju.estateagents.base.BaseController;
6
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
7
 import com.huiju.estateagents.base.ResponseBean;
8
 import com.huiju.estateagents.entity.ExtendContent;
8
 import com.huiju.estateagents.entity.ExtendContent;
9
+import com.huiju.estateagents.entity.TaBuildingDynamic;
9
 import com.huiju.estateagents.service.IExtendContentService;
10
 import com.huiju.estateagents.service.IExtendContentService;
11
+import com.huiju.estateagents.service.ITaBuildingDynamicService;
12
+import com.huiju.estateagents.service.ITaBuildingService;
13
+import org.apache.commons.lang3.StringUtils;
10
 import org.slf4j.Logger;
14
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
15
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.web.bind.annotation.ResponseBody;
22
 import org.springframework.web.bind.annotation.ResponseBody;
19
 import org.springframework.web.bind.annotation.RestController;
23
 import org.springframework.web.bind.annotation.RestController;
20
 
24
 
25
+import java.time.LocalDateTime;
26
+
21
 /**
27
 /**
22
  * <p>
28
  * <p>
23
     * 辅助内容表  前端控制器
29
     * 辅助内容表  前端控制器
35
     @Autowired
41
     @Autowired
36
     public IExtendContentService iExtendContentService;
42
     public IExtendContentService iExtendContentService;
37
 
43
 
44
+    @Autowired
45
+    private ITaBuildingDynamicService iTaBuildingDynamicService;
46
+
38
 
47
 
39
     /**
48
     /**
40
      * 分页查询列表
49
      * 分页查询列表
44
      */
53
      */
45
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.GET)
54
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.GET)
46
     public ResponseBean extendContentList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
     public ResponseBean extendContentList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
-                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
56
+                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                          @RequestParam(value = "buildingId", required = false) String buildingId,
58
+                                          @RequestParam(value = "showType", required = false) String showType){
48
         ResponseBean responseBean = new ResponseBean();
59
         ResponseBean responseBean = new ResponseBean();
49
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
60
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
50
-            IPage<ExtendContent> result = iExtendContentService.page(pg);
61
+            QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
62
+            queryWrapper.eq(StringUtils.isNotBlank(buildingId), "building_id", buildingId);
63
+            queryWrapper.eq(StringUtils.isNotBlank(showType), "show_type", showType);
64
+            queryWrapper.orderByDesc("create_date");
65
+            IPage<ExtendContent> result = iExtendContentService.page(pg, queryWrapper);
51
             responseBean.addSuccess(result);
66
             responseBean.addSuccess(result);
52
             return responseBean;
67
             return responseBean;
53
     }
68
     }
74
      */
89
      */
75
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
90
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
76
     public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
91
     public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
92
+        extendContent.setCreateDate(LocalDateTime.now());
77
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
93
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
78
           responseBean.addSuccess(extendContent);
94
           responseBean.addSuccess(extendContent);
79
           return responseBean;
95
           return responseBean;
111
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
127
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
112
                                         @RequestBody ExtendContent extendContent){
128
                                         @RequestBody ExtendContent extendContent){
113
         ResponseBean responseBean = new ResponseBean();
129
         ResponseBean responseBean = new ResponseBean();
130
+        extendContent.setContentId(id);
114
         try {
131
         try {
115
             if (iExtendContentService.updateById(extendContent)){
132
             if (iExtendContentService.updateById(extendContent)){
116
                 responseBean.addSuccess(extendContent);
133
                 responseBean.addSuccess(extendContent);
133
     public ResponseBean extendContentGet(@PathVariable Integer id){
150
     public ResponseBean extendContentGet(@PathVariable Integer id){
134
         ResponseBean responseBean = new ResponseBean();
151
         ResponseBean responseBean = new ResponseBean();
135
         try {
152
         try {
136
-            responseBean.addSuccess(iExtendContentService.getById(id));
153
+            ExtendContent extendContent = iExtendContentService.getById(id);
154
+            TaBuildingDynamic taBuildingDynamic = iTaBuildingDynamicService.getById(extendContent.getTargetId());
155
+            extendContent.setTargetName(taBuildingDynamic.getTitle());
156
+            responseBean.addSuccess(extendContent);
137
         }catch (Exception e){
157
         }catch (Exception e){
138
             e.printStackTrace();
158
             e.printStackTrace();
139
             logger.error("extendContentDelete -=- {}",e.toString());
159
             logger.error("extendContentDelete -=- {}",e.toString());

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/ExtendContent.java 파일 보기

1
 package com.huiju.estateagents.entity;
1
 package com.huiju.estateagents.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import com.baomidou.mybatisplus.annotation.IdType;
5
 import com.baomidou.mybatisplus.annotation.IdType;
5
 import com.baomidou.mybatisplus.annotation.TableId;
6
 import com.baomidou.mybatisplus.annotation.TableId;
51
      */
52
      */
52
     private String targetId;
53
     private String targetId;
53
 
54
 
55
+    @TableField(exist = false)
56
+    private String targetName;
57
+
54
     /**
58
     /**
55
      * 图片
59
      * 图片
56
      */
60
      */