| | |
| | | */ |
| | | package org.springblade.modules.ownersCommittee.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | 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.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeMemberEntity; |
| | | import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeMemberService; |
| | | import org.springblade.modules.ownersCommittee.vo.OwnersCommitteeMemberVO; |
| | | import org.springblade.modules.ownersCommittee.wrapper.OwnersCommitteeMemberWrapper; |
| | | import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeMemberService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 业委会成员表 控制器 |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入ownersCommittee") |
| | | public R submit(@Valid @RequestBody OwnersCommitteeMemberEntity ownersCommittee) { |
| | | long count = ownersCommitteeService.count(Wrappers.<OwnersCommitteeMemberEntity>lambdaQuery() |
| | | .eq(OwnersCommitteeMemberEntity::getAreaId, ownersCommittee.getAreaId()) |
| | | .eq(OwnersCommitteeMemberEntity::getUserId, ownersCommittee.getUserId())); |
| | | if (count > 0) { |
| | | return R.fail("该业委会成员已存在"); |
| | | } |
| | | return R.status(ownersCommitteeService.saveOrUpdate(ownersCommittee)); |
| | | } |
| | | |