Authored by mali

视频直播

package com.yoho.ufo.order.service.impl;
import com.yoho.order.dal.CameraRecordMapper;
import com.yoho.order.model.CameraRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* Created by li.ma on 2019/5/8.
*/
@Service
public class CameraRecordService {
@Autowired
private CameraRecordMapper cameraRecordMapper;
public String selectNameByCode(Integer cameraCode) {
if (null == cameraCode) {
return "";
}
List<CameraRecord> cameraRecordList = cameraRecordMapper.selectAllCameraRecord();
final String result;
for (CameraRecord item : cameraRecordList) {
if (cameraCode.equals(item.getCameraCode())) {
return item.getCameraName();
}
}
return "";
}
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.ufo.order.service.impl;
import com.yoho.error.exception.ServiceException;
import com.yoho.order.dal.AreaMapper;
import com.yoho.order.dal.CameraRecordMapper;
import com.yoho.order.dal.PhoneUidCameraMapper;
import com.yoho.order.model.Area;
import com.yoho.order.model.PhoneUidCamera;
... ... @@ -28,6 +29,9 @@ public class PhoneUidCameraService {
@Autowired
private AreaMapper areaMapper;
@Autowired
private CameraRecordService cameraRecordService;
public boolean insert(PhoneUidCameraBo record) {
if (StringUtils.isEmpty(record.getPhoneUid()) || null == record.getCameraCode()) {
return false;
... ... @@ -57,6 +61,7 @@ public class PhoneUidCameraService {
PhoneUidCameraBo bo = new PhoneUidCameraBo();
bo.setCameraCode(phoneUidCamera.getCameraCode());
bo.setPhoneUid(phoneUidCamera.getPhoneUid());
bo.setCameraName(cameraRecordService.selectNameByCode(phoneUidCamera.getCameraCode()));
return bo;
}
... ...