Commit 71430389 authored by 蔡镇泽's avatar 蔡镇泽

校验服务机构是否已存在

parent 91e1ec55
...@@ -22,7 +22,6 @@ import com.hungraim.ltc.util.ResultCode; ...@@ -22,7 +22,6 @@ import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -47,8 +46,7 @@ public class SrvOrganServiceImpl implements SrvOrganService { ...@@ -47,8 +46,7 @@ public class SrvOrganServiceImpl implements SrvOrganService {
private final AttachFeignService attachFeignService; private final AttachFeignService attachFeignService;
@Autowired private final ChSrvorganRiskLevelMapper chSrvorganRiskLevelMapper;
private ChSrvorganRiskLevelMapper chSrvorganRiskLevelMapper;
@Override @Override
...@@ -106,9 +104,12 @@ public class SrvOrganServiceImpl implements SrvOrganService { ...@@ -106,9 +104,12 @@ public class SrvOrganServiceImpl implements SrvOrganService {
// 添加操作 // 添加操作
//校验服务机构是否已存在 //校验服务机构是否已存在
ChSrvOrgan selectOrgan = srvOrganMapper.selectOne(new LambdaQueryWrapper<ChSrvOrgan>() ChSrvOrgan selectOrgan = srvOrganMapper.selectOne(new LambdaQueryWrapper<ChSrvOrgan>()
.eq(ChSrvOrgan::getOrganId, srvOrganVo.getOrganId()) .eq(ChSrvOrgan::getUnifiedSocialCreditCode, srvOrganVo.getUnifiedSocialCreditCode())
.eq(ChSrvOrgan::getStatus, 0)); .eq(ChSrvOrgan::getStatus, 0));
if (selectOrgan != null) { ChSrvOrgan selectOrgan1 = srvOrganMapper.selectOne(new LambdaQueryWrapper<ChSrvOrgan>()
.eq(ChSrvOrgan::getPermitId, srvOrganVo.getPermitId())
.eq(ChSrvOrgan::getStatus, 0));
if (selectOrgan != null || selectOrgan1 != null) {
throw new RuntimeException("服务机构已存在,请不要重复添加"); throw new RuntimeException("服务机构已存在,请不要重复添加");
} }
chSrvOrgan.setStatus(0); chSrvOrgan.setStatus(0);
......
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