Commit 8eb732d2 authored by 蔡镇泽's avatar 蔡镇泽

系统允许新增两条一模一样的数据,正常应该报错

parent 29177879
......@@ -236,6 +236,14 @@ public class DisableController {
}
/**
* 获取审核人信息
*/
@RequestMapping("/disableExamine")
public Result getReviewer() {
return Result.success();
}
/**
* 修改失能申请
*/
@RequestMapping("/updateDisable")
......
......@@ -88,7 +88,11 @@ public class SrvOrganController {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
// 参数校验通过,调用service添加护理机构
srvOrganService.saveOrUpdateSrvOrgan(srvOrganVo);
try {
srvOrganService.saveOrUpdateSrvOrgan(srvOrganVo);
} catch (RuntimeException e) {
return Result.failed(e.getMessage());
}
return Result.success();
}
......
package com.hungraim.ltc.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*;
......@@ -104,6 +104,13 @@ public class SrvOrganServiceImpl implements SrvOrganService {
}
} else {
// 添加操作
//校验服务机构是否已存在
ChSrvOrgan selectOrgan = srvOrganMapper.selectOne(new LambdaQueryWrapper<ChSrvOrgan>()
.eq(ChSrvOrgan::getOrganId, srvOrganVo.getOrganId())
.eq(ChSrvOrgan::getStatus, 0));
if (selectOrgan != null) {
throw new RuntimeException("服务机构已存在,请不要重复添加");
}
chSrvOrgan.setStatus(0);
chSrvOrgan.setEffTime(new Date());
srvOrganMapper.insert(chSrvOrgan);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment