|
|
@@ -23,6 +23,7 @@ import com.hfln.portal.common.request.room.RoomParam;
|
|
|
import com.hfln.portal.common.request.room.SubRegionInfo;
|
|
|
import com.hfln.portal.common.request.share.ShareConfirmParam;
|
|
|
import com.hfln.portal.common.request.share.ShareParam;
|
|
|
+import com.hfln.portal.common.request.share.UrlShareConfirmParam;
|
|
|
import com.hfln.portal.common.request.share.updateShareParam;
|
|
|
import com.hfln.portal.common.response.device.UsedInfoQueryRes;
|
|
|
import com.hfln.portal.common.vo.PageRecord;
|
|
|
@@ -713,6 +714,35 @@ public class DeviceGatewayImpl implements DeviceGateway {
|
|
|
return dto;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void urlShareConfirm (UrlShareConfirmParam param) {
|
|
|
+ //1.查询分享记录信息
|
|
|
+ DevShare devShare = devShareService.getById(param.getShareId());
|
|
|
+
|
|
|
+ //2.校验分享信息是否存在
|
|
|
+ if (devShare == null) {
|
|
|
+ throw new BizException(ErrorEnum.SHARE_INFO_NOT_EXIST.getErrorCode(), ErrorEnum.SHARE_INFO_NOT_EXIST.getErrorMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ //3.校验分享是否已经被处理
|
|
|
+ if (devShare.getState() == null || devShare.getState() != 0){
|
|
|
+ throw new BizException(ErrorEnum.SHARE_INFO_ALREADY_DEAL.getErrorCode(), ErrorEnum.SHARE_INFO_ALREADY_DEAL.getErrorMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ //4.校验被分享人是否注册
|
|
|
+ UserInfo userInfo = userService.queryById(param.getSharedUserId());
|
|
|
+ if (userInfo == null) {
|
|
|
+ throw new BizException(ErrorEnum.USER_NOT_FOUND.getErrorCode(), ErrorEnum.USER_NOT_FOUND.getErrorMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ //5.保存分享信息(将入参写入该记录)
|
|
|
+ devShare.setSharedUserId(param.getSharedUserId());
|
|
|
+ devShare.setSharedPhone(param.getSharedPhone());
|
|
|
+ devShare.setState(param.getState()); // 1-已确认,2-已拒绝
|
|
|
+ devShareService.updateById(devShare);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<ShareDto> queryDevShare(Long userId) {
|
|
|
|