|
@@ -3,8 +3,14 @@ package com.ruoyi.business.service.impl;
|
|
|
import com.ruoyi.business.domain.ZwywLrJgyy;
|
|
|
import com.ruoyi.business.mapper.ZwywLrJgyyMapper;
|
|
|
import com.ruoyi.business.service.IZwywLrJgyyService;
|
|
|
+import com.ruoyi.common.core.constant.SecurityConstants;
|
|
|
+import com.ruoyi.common.core.context.SecurityContextHolder;
|
|
|
import com.ruoyi.common.core.exception.ServiceException;
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
+import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
|
+import com.ruoyi.system.api.RemoteUserService;
|
|
|
+import com.ruoyi.system.api.model.LoginUser;
|
|
|
+import io.seata.common.util.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -24,6 +30,9 @@ public class ZwywLrJgyyServiceImpl implements IZwywLrJgyyService
|
|
|
@Autowired
|
|
|
private ZwywLrJgyyMapper zwywLrJgyyMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RemoteUserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询老人机构预约
|
|
|
*
|
|
@@ -81,6 +90,12 @@ public class ZwywLrJgyyServiceImpl implements IZwywLrJgyyService
|
|
|
@Override
|
|
|
public int insertPortalZwywLrJgyy(ZwywLrJgyy zwywLrJgyy)
|
|
|
{
|
|
|
+ if (CollectionUtils.isNotEmpty(zwywLrJgyyMapper.selectPortalZwywLrJgyyList(zwywLrJgyy))) {
|
|
|
+ throw new ServiceException("您已经在该机构预约");
|
|
|
+ }
|
|
|
+ LoginUser user = userService.getUserInfo("admin", SecurityConstants.INNER).getData();
|
|
|
+ SecurityContextHolder.set(SecurityConstants.LOGIN_USER, user);
|
|
|
+ zwywLrJgyy.setId(IdUtils.simpleUUID());
|
|
|
zwywLrJgyy.setCreateAreaCode(zwywLrJgyy.getLrjzdzxzqh());
|
|
|
return zwywLrJgyyMapper.insertPortalZwywLrJgyy(zwywLrJgyy);
|
|
|
}
|