张延森 5 anos atrás
pai
commit
c797807fde

+ 9
- 2
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java Ver arquivo

@@ -44,6 +44,8 @@ public class ExtendContentController extends BaseController {
44 44
     @Autowired
45 45
     private ITaBuildingDynamicService iTaBuildingDynamicService;
46 46
 
47
+    @Autowired
48
+    private ITaBuildingService iTaBuildingService;
47 49
 
48 50
     /**
49 51
      * 分页查询列表
@@ -76,8 +78,9 @@ public class ExtendContentController extends BaseController {
76 78
                                                   @RequestParam(value = "targetId", required = false) String targetId,
77 79
                                                   @RequestParam(value = "contentType", required = false) String contentType,
78 80
                                                   @RequestParam(value = "buildingId", required = false) String buildingId,
79
-                                                  @RequestParam(value = "contentId", required = false) String contentId){
80
-        ResponseBean responseBean= iExtendContentService.selectExtendContentListShowType(showType, showPosition, targetId,contentType, buildingId, contentId);
81
+                                                  @RequestParam(value = "contentId", required = false) String contentId,
82
+                                                  @RequestParam(value = "cityId", required = false) Integer cityId){
83
+        ResponseBean responseBean= iExtendContentService.selectExtendContentListShowType(showType, showPosition, targetId,contentType, buildingId, contentId, cityId);
81 84
         return responseBean;
82 85
     }
83 86
 
@@ -89,6 +92,8 @@ public class ExtendContentController extends BaseController {
89 92
      */
90 93
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
91 94
     public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
95
+        Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
96
+        extendContent.setCityId(cityId);
92 97
         extendContent.setCreateDate(LocalDateTime.now());
93 98
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
94 99
           responseBean.addSuccess(extendContent);
@@ -129,6 +134,8 @@ public class ExtendContentController extends BaseController {
129 134
         ResponseBean responseBean = new ResponseBean();
130 135
         extendContent.setContentId(id);
131 136
         try {
137
+            Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
138
+            extendContent.setCityId(cityId);
132 139
             if (iExtendContentService.updateById(extendContent)){
133 140
                 responseBean.addSuccess(extendContent);
134 141
             }else {

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/ExtendContent.java Ver arquivo

@@ -90,5 +90,5 @@ public class ExtendContent implements Serializable {
90 90
      */
91 91
     private String buildingId;
92 92
 
93
-
93
+    private Integer cityId;
94 94
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/service/IExtendContentService.java Ver arquivo

@@ -34,7 +34,8 @@ public interface IExtendContentService extends IService<ExtendContent> {
34 34
      * 开屏
35 35
      * @param contentType
36 36
      * @param buildingId
37
+     * @param cityId
37 38
      * @return
38 39
      */
39
-    ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId);
40
+    ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId, Integer cityId);
40 41
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/service/impl/ExtendContentServiceImpl.java Ver arquivo

@@ -59,7 +59,7 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
59 59
     }
60 60
 
61 61
     @Override
62
-    public ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId) {
62
+    public ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId, Integer cityId) {
63 63
         ResponseBean responseBean= new ResponseBean<>();
64 64
         // 开屏
65 65
         QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
@@ -71,6 +71,7 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
71 71
         // activity(活动) 或 project(项目) 或 news(咨迅)
72 72
         extendContentQuery.eq(StringUtils.isNotBlank(contentType), "content_type",contentType);
73 73
         extendContentQuery.eq(StringUtils.isNotBlank(buildingId), "building_id",buildingId);
74
+        extendContentQuery.eq(null != cityId && cityId != 0, "city_id", cityId);
74 75
         extendContentQuery.eq("status","1");
75 76
         List<ExtendContent> taExtendContent = extendContentMapper.selectList(extendContentQuery);
76 77
         responseBean.addSuccess(taExtendContent);