| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity; |
| | | import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeMemberEntity; |
| | | import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeMemberService; |
| | | import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeService; |
| | | import org.springblade.modules.ownersCommittee.vo.OwnersCommitteeMemberVO; |
| | | import org.springblade.modules.ownersCommittee.wrapper.OwnersCommitteeMemberWrapper; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | OwnersCommitteeMemberEntity detail = ownersCommitteeService.getOne(Condition.getQueryWrapper(ownersCommittee)); |
| | | return R.data(OwnersCommitteeMemberWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 业委会成员表 分页 |
| | | */ |
| | |
| | | long count = ownersCommitteeService.count(Wrappers.<OwnersCommitteeMemberEntity>lambdaQuery() |
| | | .eq(OwnersCommitteeMemberEntity::getAreaId, ownersCommittee.getAreaId()) |
| | | .eq(OwnersCommitteeMemberEntity::getUserId, ownersCommittee.getUserId())); |
| | | if (count > 0 && ownersCommittee.getId() != null) { |
| | | if (count > 1 && ownersCommittee.getId() != null) { |
| | | return R.fail("该业委会成员已存在"); |
| | | } |
| | | long number = ownersCommitteeService.count(Wrappers.<OwnersCommitteeMemberEntity>lambdaQuery() |
| | | .eq(OwnersCommitteeMemberEntity::getOwnersId, ownersCommittee.getOwnersId())); |
| | | IOwnersCommitteeService bean = SpringUtils.getBean(IOwnersCommitteeService.class); |
| | | OwnersCommitteeEntity committeeEntity = bean.getById(ownersCommittee.getOwnersId()); |
| | | committeeEntity.setPeopleTotal(String.valueOf(number)); |
| | | bean.updateById(committeeEntity); |
| | | return R.status(ownersCommitteeService.saveOrUpdate(ownersCommittee)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(ownersCommitteeService.removeBatchByIds(Func.toLongList(ids))); |
| | | return R.status(ownersCommitteeService.removeOwnersCommittee(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |