|
|
|
|
559
|
@Override
|
559
|
@Override
|
560
|
public ResponseBean buildingUpdateStatus(String parameter, Integer orgId) {
|
560
|
public ResponseBean buildingUpdateStatus(String parameter, Integer orgId) {
|
561
|
ResponseBean responseBean = new ResponseBean();
|
561
|
ResponseBean responseBean = new ResponseBean();
|
562
|
- TaBuilding building = new TaBuilding();
|
|
|
|
|
562
|
+
|
563
|
JSONObject jsonobject = JSONObject.parseObject(parameter);
|
563
|
JSONObject jsonobject = JSONObject.parseObject(parameter);
|
564
|
Integer status= jsonobject.getInteger("status");
|
564
|
Integer status= jsonobject.getInteger("status");
|
565
|
String id = jsonobject.getString("id");
|
565
|
String id = jsonobject.getString("id");
|
566
|
QueryWrapper<TaBuilding> buildingIdQueryWrapper = new QueryWrapper<>();
|
566
|
QueryWrapper<TaBuilding> buildingIdQueryWrapper = new QueryWrapper<>();
|
567
|
buildingIdQueryWrapper.eq("building_id", id);
|
567
|
buildingIdQueryWrapper.eq("building_id", id);
|
568
|
buildingIdQueryWrapper.eq("org_id", orgId);
|
568
|
buildingIdQueryWrapper.eq("org_id", orgId);
|
569
|
- building.setBuildingId(id);
|
|
|
570
|
- building.setStatus(status);
|
|
|
|
|
569
|
+ TaBuilding building = taBuildingMapper.selectOne(buildingIdQueryWrapper);
|
571
|
|
570
|
|
572
|
- boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(taBuildingMapper.selectOne(buildingIdQueryWrapper), orgId, status, "updateStatus");
|
|
|
|
|
571
|
+ boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, status, "updateStatus");
|
573
|
if (!isMainMoreThanTenFlag){
|
572
|
if (!isMainMoreThanTenFlag){
|
574
|
responseBean.addError("当前城市最多只能推荐10个项目至首页哦");
|
573
|
responseBean.addError("当前城市最多只能推荐10个项目至首页哦");
|
575
|
return responseBean;
|
574
|
return responseBean;
|
576
|
}
|
575
|
}
|
577
|
-
|
|
|
|
|
576
|
+ building.setStatus(status);
|
578
|
taBuildingMapper.update(building,buildingIdQueryWrapper);
|
577
|
taBuildingMapper.update(building,buildingIdQueryWrapper);
|
579
|
return ResponseBean.success("");
|
578
|
return ResponseBean.success("");
|
580
|
}
|
579
|
}
|