addTeam接口校验是否已存在记录
This commit is contained in:
parent
84fd473b76
commit
8315a63490
|
|
@ -6,6 +6,7 @@ import com.ghy.common.core.page.TableDataInfo;
|
|||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.worker.domain.WorkerTeam;
|
||||
import com.ghy.worker.service.WorkerTeamService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -26,6 +27,11 @@ public class WorkerTeamController extends BaseController {
|
|||
@ResponseBody
|
||||
public AjaxResult addTeam(@RequestBody WorkerTeam workerTeam){
|
||||
try {
|
||||
List<WorkerTeam> workerTeams = workerTeamService.getWorkerTeam(workerTeam);
|
||||
if (CollectionUtils.isNotEmpty(workerTeams)) {
|
||||
return AjaxResult.warn("已加入,请不要重复操作");
|
||||
}
|
||||
|
||||
int result = workerTeamService.insertWorkerTeam(workerTeam);
|
||||
if(result > 0){
|
||||
return AjaxResult.success("新增成功");
|
||||
|
|
|
|||
Loading…
Reference in New Issue