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