Browse Source

Merge branch 'v3' of http://git.ycjcjy.com/zhiyuxing/estateagents into v3

胡轶钦 5 years ago
parent
commit
0ed48b7047

+ 7
- 3
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java View File

22
 import org.springframework.web.bind.annotation.ResponseBody;
22
 import org.springframework.web.bind.annotation.ResponseBody;
23
 import org.springframework.web.bind.annotation.RestController;
23
 import org.springframework.web.bind.annotation.RestController;
24
 
24
 
25
+import javax.servlet.http.HttpServletRequest;
25
 import java.time.LocalDateTime;
26
 import java.time.LocalDateTime;
26
 
27
 
27
 /**
28
 /**
60
                                           @RequestParam(value = "contentType", required = false) String contentType,
61
                                           @RequestParam(value = "contentType", required = false) String contentType,
61
                                           @RequestParam(value = "showPosition", required = false) String showPosition,
62
                                           @RequestParam(value = "showPosition", required = false) String showPosition,
62
                                           @RequestParam(value = "status", required = false) Integer status,
63
                                           @RequestParam(value = "status", required = false) Integer status,
63
-                                          @RequestParam(value = "showType", required = false) String showType){
64
+                                          @RequestParam(value = "showType", required = false) String showType,HttpServletRequest request){
64
         ResponseBean responseBean = new ResponseBean();
65
         ResponseBean responseBean = new ResponseBean();
65
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
66
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
66
             QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
67
             QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
69
             queryWrapper.eq(StringUtils.isNotBlank(contentType), "content_type", contentType);
70
             queryWrapper.eq(StringUtils.isNotBlank(contentType), "content_type", contentType);
70
             queryWrapper.eq(StringUtils.isNotBlank(showPosition), "show_position", showPosition);
71
             queryWrapper.eq(StringUtils.isNotBlank(showPosition), "show_position", showPosition);
71
             queryWrapper.eq(null!=status, "status", status);
72
             queryWrapper.eq(null!=status, "status", status);
73
+            queryWrapper.eq( "org_id", getOrgId(request));
72
             queryWrapper.orderByDesc("create_date");
74
             queryWrapper.orderByDesc("create_date");
73
             IPage<ExtendContent> result = iExtendContentService.page(pg, queryWrapper);
75
             IPage<ExtendContent> result = iExtendContentService.page(pg, queryWrapper);
74
             responseBean.addSuccess(result);
76
             responseBean.addSuccess(result);
97
      * @return
99
      * @return
98
      */
100
      */
99
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
101
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
100
-    public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
102
+    public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent, HttpServletRequest request){
101
         Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
103
         Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
102
         extendContent.setCityId(cityId);
104
         extendContent.setCityId(cityId);
103
         extendContent.setCreateDate(LocalDateTime.now());
105
         extendContent.setCreateDate(LocalDateTime.now());
106
+        extendContent.setOrgId(getOrgId(request));
104
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
107
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
105
           responseBean.addSuccess(extendContent);
108
           responseBean.addSuccess(extendContent);
106
           return responseBean;
109
           return responseBean;
136
      */
139
      */
137
     @RequestMapping(value="/admin/extendContent/{id}",method= RequestMethod.PUT)
140
     @RequestMapping(value="/admin/extendContent/{id}",method= RequestMethod.PUT)
138
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
141
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
139
-                                        @RequestBody ExtendContent extendContent){
142
+                                        @RequestBody ExtendContent extendContent,HttpServletRequest request){
140
         ResponseBean responseBean = new ResponseBean();
143
         ResponseBean responseBean = new ResponseBean();
141
         extendContent.setContentId(id);
144
         extendContent.setContentId(id);
142
         try {
145
         try {
143
             Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
146
             Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
144
             extendContent.setCityId(cityId);
147
             extendContent.setCityId(cityId);
148
+            extendContent.setOrgId(getOrgId(request));
145
             if (iExtendContentService.updateById(extendContent)){
149
             if (iExtendContentService.updateById(extendContent)){
146
                 responseBean.addSuccess(extendContent);
150
                 responseBean.addSuccess(extendContent);
147
             }else {
151
             }else {