|
|
|
|
7
|
import com.huiju.estateagents.base.ResponseBean;
|
7
|
import com.huiju.estateagents.base.ResponseBean;
|
8
|
import com.huiju.estateagents.common.BeanTools;
|
8
|
import com.huiju.estateagents.common.BeanTools;
|
9
|
import com.huiju.estateagents.entity.TaBuilding;
|
9
|
import com.huiju.estateagents.entity.TaBuilding;
|
|
|
10
|
+import com.huiju.estateagents.entity.TaNews;
|
10
|
import com.huiju.estateagents.entity.TaNewsType;
|
11
|
import com.huiju.estateagents.entity.TaNewsType;
|
11
|
import com.huiju.estateagents.exception.EstaException;
|
12
|
import com.huiju.estateagents.exception.EstaException;
|
12
|
import com.huiju.estateagents.mapper.TaNewsTypeMapper;
|
13
|
import com.huiju.estateagents.mapper.TaNewsTypeMapper;
|
13
|
import com.huiju.estateagents.service.ITaBuildingService;
|
14
|
import com.huiju.estateagents.service.ITaBuildingService;
|
|
|
15
|
+import com.huiju.estateagents.service.ITaNewsService;
|
14
|
import com.huiju.estateagents.service.ITaNewsTypeService;
|
16
|
import com.huiju.estateagents.service.ITaNewsTypeService;
|
15
|
import org.apache.commons.lang3.StringUtils;
|
17
|
import org.apache.commons.lang3.StringUtils;
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
18
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
32
|
@Autowired
|
34
|
@Autowired
|
33
|
private ITaBuildingService iTaBuildingService;
|
35
|
private ITaBuildingService iTaBuildingService;
|
34
|
|
36
|
|
|
|
37
|
+ @Autowired
|
|
|
38
|
+ private ITaNewsService iTaNewsService;
|
|
|
39
|
+
|
35
|
|
40
|
|
36
|
@Override
|
41
|
@Override
|
37
|
public ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, Integer orgId) {
|
42
|
public ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, Integer orgId) {
|
|
|
|
|
100
|
if (null == taBuilding) {
|
105
|
if (null == taBuilding) {
|
101
|
throw new EstaException("楼盘不存在!");
|
106
|
throw new EstaException("楼盘不存在!");
|
102
|
}
|
107
|
}
|
|
|
108
|
+ if (taNewsType.getStatus() != null && taNewsType.getStatus() == -1) {
|
|
|
109
|
+ QueryWrapper<TaNews> queryWrapper = new QueryWrapper<>();
|
|
|
110
|
+ queryWrapper.gt("status", -1);
|
|
|
111
|
+ queryWrapper.eq("news_type_id", taNewsType.getNewsTypeId());
|
|
|
112
|
+ Integer newsCount = iTaNewsService.count(queryWrapper);
|
|
|
113
|
+ if (newsCount != null && newsCount > 0) {
|
|
|
114
|
+ throw new EstaException("有资讯正在使用此资讯类型!");
|
|
|
115
|
+ }
|
|
|
116
|
+ }
|
|
|
117
|
+
|
103
|
}
|
118
|
}
|
104
|
|
119
|
|
105
|
@Override
|
120
|
@Override
|