|
@@ -7,6 +7,7 @@ import com.bz.smart_city.commom.util.UserUtil;
|
|
|
import com.bz.smart_city.commom.util.Util;
|
|
|
import com.bz.smart_city.dao.AreaMapper;
|
|
|
import com.bz.smart_city.dao.CommunityMapper;
|
|
|
+import com.bz.smart_city.dao.pay.PayBaseAccountMapper;
|
|
|
import com.bz.smart_city.dto.BuildingSelectDto;
|
|
|
import com.bz.smart_city.dto.CommunityDto;
|
|
|
import com.bz.smart_city.dto.LoginUser;
|
|
@@ -35,6 +36,9 @@ public class CommunityServiceImpl implements CommunityService{
|
|
|
@Resource
|
|
|
private AreaMapper areaMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private PayBaseAccountMapper payBaseAccountMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public int insert(Community community){
|
|
|
community.setCreateBy("system");
|
|
@@ -167,6 +171,11 @@ public class CommunityServiceImpl implements CommunityService{
|
|
|
public void deleteCommunity(Integer communityId) {
|
|
|
log.info("Begin DeleteCommunity CommunityId" + communityId);
|
|
|
|
|
|
+ int result = payBaseAccountMapper.findCommunityCount(communityId);
|
|
|
+ if(result > 0){
|
|
|
+ throw new ServiceException(-900,"该小区已经使用,不能删除");
|
|
|
+ }
|
|
|
+
|
|
|
Community community = new Community();
|
|
|
community.setId(communityId);
|
|
|
community.setStatus(0);
|