|
@ -49,8 +49,8 @@ public class BuildingCommunityController { |
|
|
) { |
|
|
) { |
|
|
try { |
|
|
try { |
|
|
QueryWrapper<BuildingCommunity> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<BuildingCommunity> qw = new QueryWrapper<>(); |
|
|
if(StringUtils.isNotBlank(entity.getKeyword())){ |
|
|
if (StringUtils.isNotBlank(entity.getKeyword())) { |
|
|
qw.like("bc.name",entity.getKeyword()); |
|
|
qw.like("bc.name", entity.getKeyword()); |
|
|
} |
|
|
} |
|
|
IPage<BuildingCommunity> page = IBuildingCommunityService.pagerList(new Page<BuildingCommunity>(pageNum, pageSize), qw); |
|
|
IPage<BuildingCommunity> page = IBuildingCommunityService.pagerList(new Page<BuildingCommunity>(pageNum, pageSize), qw); |
|
|
return new CommonResult().success(page); |
|
|
return new CommonResult().success(page); |
|
@ -70,10 +70,12 @@ public class BuildingCommunityController { |
|
|
entity.setCreateTime(new Date()); |
|
|
entity.setCreateTime(new Date()); |
|
|
entity.setStatus(StatusEnum.AuditType.SUCESS.code()); |
|
|
entity.setStatus(StatusEnum.AuditType.SUCESS.code()); |
|
|
if (ValidatorUtils.empty(entity.getCompanyId())) { |
|
|
if (ValidatorUtils.empty(entity.getCompanyId())) { |
|
|
// entity.setCompanyId(UserUtils.getCurrentMember().getStoreId());
|
|
|
return new CommonResult().failed("请选择物业啊"); |
|
|
} |
|
|
} |
|
|
if (ValidatorUtils.empty(entity.getCompanyId())) { |
|
|
//判断该物业是否存在相同小区的名称
|
|
|
return new CommonResult().failed("请选择物业攻啊"); |
|
|
int count = IBuildingCommunityService.selectByNameAndCompanyId(entity.getName(),entity.getCompanyId()); |
|
|
|
|
|
if(count > 0){ |
|
|
|
|
|
return new CommonResult().failed("该取货点已存在"); |
|
|
} |
|
|
} |
|
|
if (IBuildingCommunityService.saveCommunity(entity)) { |
|
|
if (IBuildingCommunityService.saveCommunity(entity)) { |
|
|
return new CommonResult().success(); |
|
|
return new CommonResult().success(); |
|
@ -91,6 +93,11 @@ public class BuildingCommunityController { |
|
|
|
|
|
|
|
|
public Object updateBuildingCommunity(@RequestBody BuildingCommunity entity) { |
|
|
public Object updateBuildingCommunity(@RequestBody BuildingCommunity entity) { |
|
|
try { |
|
|
try { |
|
|
|
|
|
//判断该物业是否存在相同小区的名称
|
|
|
|
|
|
int count = IBuildingCommunityService.selectByNameAndCompanyIdAndId(entity.getName(),entity.getCompanyId(),entity.getId()); |
|
|
|
|
|
if(count > 0){ |
|
|
|
|
|
return new CommonResult().failed("该取货点已存在"); |
|
|
|
|
|
} |
|
|
if (IBuildingCommunityService.updateById(entity)) { |
|
|
if (IBuildingCommunityService.updateById(entity)) { |
|
|
return new CommonResult().success(); |
|
|
return new CommonResult().success(); |
|
|
} |
|
|
} |
|
|