This commit is contained in:
佟明轩 2025-06-05 13:36:30 +08:00
parent 7bdeca12a1
commit ba39cce61c
1 changed files with 11 additions and 10 deletions

View File

@ -126,17 +126,18 @@ public class ItemService extends BaseService {
if (item.getUnitPrice() == null || item.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0) {
throw new MessageException("售价不能小于0");
}
if (item.getSocialCode() == null || item.getSocialCode().isEmpty()) {
throw new MessageException("项目医保目录编码不能为空");
}
SocialItem socialItem = socialItemMapper.selectOne(new QueryWrapper<SocialItem>().eq("code", item.getSocialCode()));
if (socialItem == null){
throw new MessageException("医保目录中未找到医保码为"+item.getSocialCode()+"的医疗服务项目");
}
Item codeItem = itemMapper.selectOne(new QueryWrapper<Item>().eq("social_code", item.getSocialCode()));
if (codeItem != null &&(item.getId() == null || !item.getId().equals(codeItem.getId()))){
throw new MessageException("医保码"+item.getSocialCode()+"已存在绑定的医疗项目");
if (!item.getSocialCode().isEmpty())
{
SocialItem socialItem = socialItemMapper.selectOne(new QueryWrapper<SocialItem>().eq("code", item.getSocialCode()));
if (socialItem == null){
throw new MessageException("医保目录中未找到医保码为"+item.getSocialCode()+"的医疗服务项目");
}
Item codeItem = itemMapper.selectOne(new QueryWrapper<Item>().eq("social_code", item.getSocialCode()));
if (codeItem != null &&(item.getId() == null || !item.getId().equals(codeItem.getId()))){
throw new MessageException("医保码"+item.getSocialCode()+"已存在绑定的医疗项目");
}
}