api-增加小程序扫码后初始化界面逻辑接口
This commit is contained in:
@@ -3,6 +3,7 @@ package com.sv.service.api;
|
||||
import com.sv.entity.Venue;
|
||||
import com.sv.mapper.DeviceMapper;
|
||||
import com.sv.mapper.VenueMapper;
|
||||
import com.ydd.framework.core.exception.ServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -23,28 +24,16 @@ public class QRCodeService {
|
||||
@Resource
|
||||
private DeviceMapper deviceMapper;
|
||||
|
||||
public void enter(String deviceId) {
|
||||
|
||||
public void enter(Integer venueId,String deviceName) {
|
||||
}
|
||||
|
||||
public Venue initEnter(String deviceId) {
|
||||
String deviceName = getDeviceName(deviceId);
|
||||
String venueId = getVenueId(deviceId);
|
||||
int i = Integer.parseInt(venueId);
|
||||
Integer integer = deviceMapper.checkDevice(deviceName, i);
|
||||
public Venue initEnter(Integer venueId,String deviceName) {
|
||||
Integer integer = deviceMapper.checkDevice(deviceName, venueId);
|
||||
if (integer != 1){
|
||||
logger.error("设备【"+deviceId + "】未链接,活着不存在");
|
||||
return null;
|
||||
throw new ServiceException(com.sv.exception.api.ExceptionCodeTemplate.DEVICE_ERROR);
|
||||
}
|
||||
return venueMapper.findById(i);
|
||||
return venueMapper.findById(venueId);
|
||||
}
|
||||
|
||||
private String getVenueId(String deviceId){
|
||||
return deviceId.split("$-$")[1];
|
||||
}
|
||||
|
||||
private String getDeviceName(String deviceId){
|
||||
return deviceId.split("$-$")[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user