|
@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.huiju.estateagents.base.BaseController;
|
7
|
7
|
import com.huiju.estateagents.base.ResponseBean;
|
8
|
8
|
import com.huiju.estateagents.entity.TaExtendContent;
|
|
9
|
+import com.huiju.estateagents.service.ITaBuildingService;
|
9
|
10
|
import com.huiju.estateagents.service.ITaExtendContentService;
|
|
11
|
+import org.omg.CORBA.PUBLIC_MEMBER;
|
10
|
12
|
import org.slf4j.Logger;
|
11
|
13
|
import org.slf4j.LoggerFactory;
|
12
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,6 +37,8 @@ public class TaExtendContentController extends BaseController {
|
35
|
37
|
@Autowired
|
36
|
38
|
public ITaExtendContentService iTaExtendContentService;
|
37
|
39
|
|
|
40
|
+ @Autowired
|
|
41
|
+ public ITaBuildingService iTaBuildingService;
|
38
|
42
|
|
39
|
43
|
/**
|
40
|
44
|
* 分页查询列表
|
|
@@ -71,6 +75,9 @@ public class TaExtendContentController extends BaseController {
|
71
|
75
|
public ResponseBean taExtendContentAdd(@RequestBody TaExtendContent taExtendContent){
|
72
|
76
|
ResponseBean responseBean = new ResponseBean();
|
73
|
77
|
try {
|
|
78
|
+ Integer cityId = iTaBuildingService.getCityById(taExtendContent.getBuildingId());
|
|
79
|
+ taExtendContent.setCityId(cityId);
|
|
80
|
+
|
74
|
81
|
if (iTaExtendContentService.save(taExtendContent)){
|
75
|
82
|
responseBean.addSuccess(taExtendContent);
|
76
|
83
|
}else {
|
|
@@ -117,6 +124,9 @@ public class TaExtendContentController extends BaseController {
|
117
|
124
|
@RequestBody TaExtendContent taExtendContent){
|
118
|
125
|
ResponseBean responseBean = new ResponseBean();
|
119
|
126
|
try {
|
|
127
|
+ Integer cityId = iTaBuildingService.getCityById(taExtendContent.getBuildingId());
|
|
128
|
+ taExtendContent.setCityId(cityId);
|
|
129
|
+
|
120
|
130
|
if (iTaExtendContentService.updateById(taExtendContent)){
|
121
|
131
|
responseBean.addSuccess(taExtendContent);
|
122
|
132
|
}else {
|