|
|
|
@ -28,6 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
@ -93,6 +94,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
@Autowired
|
|
|
|
|
UserService userService;
|
|
|
|
|
|
|
|
|
|
@Value("${photo.address}")
|
|
|
|
|
private String photoAddress;
|
|
|
|
|
|
|
|
|
|
//服务器中的位置
|
|
|
|
|
private static final String C_PATH = "/home/xymp/photos/";
|
|
|
|
|
|
|
|
|
@ -206,7 +210,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
ArrayList<TerminalPhotoListModel.AlarmItemBean> photoalarmlist = new ArrayList<>();
|
|
|
|
|
for (TerminalImgAlarmsDto dto : imgarlarmsList) {
|
|
|
|
|
BigInteger photoOrgId = dto.getPhotoOrgId();
|
|
|
|
|
if (photoOrgId.longValue() == photoid.longValue() ) {
|
|
|
|
|
if (photoOrgId.longValue() == photoid.longValue()) {
|
|
|
|
|
TerminalPhotoListModel.AlarmItemBean alarmItemBean = new TerminalPhotoListModel.AlarmItemBean();
|
|
|
|
|
alarmItemBean.setEnname(dto.getEnname());
|
|
|
|
|
alarmItemBean.setName(dto.getName());
|
|
|
|
@ -1002,16 +1006,24 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
example.setOrderByClause("photo_time desc");
|
|
|
|
|
PageHelper.startPage(1, 1);
|
|
|
|
|
List<TerminalPhoto> list = terminalPhotoDao.selectByExample(example);
|
|
|
|
|
long lastrecv = list.get(0).getRecvTime().longValue();
|
|
|
|
|
TerminalPhoto last = list.get(0);
|
|
|
|
|
long lastrecv = last.getRecvTime().longValue();
|
|
|
|
|
result.setLastRecvTime(new Date(lastrecv * 1000));
|
|
|
|
|
long lastphoto = list.get(0).getPhotoTime().longValue();
|
|
|
|
|
long lastphoto = last.getPhotoTime().longValue();
|
|
|
|
|
result.setLastPhotoTime(new Date(lastphoto * 1000));
|
|
|
|
|
result.setLastChannelId(last.getChannelId());
|
|
|
|
|
result.setLastPhotoPath(photoAddress + last.getPath());
|
|
|
|
|
|
|
|
|
|
example.setOrderByClause("photo_time asc");
|
|
|
|
|
PageHelper.startPage(1, 1);
|
|
|
|
|
list = terminalPhotoDao.selectByExample(example);
|
|
|
|
|
long firstphoto = list.get(0).getPhotoTime().longValue();
|
|
|
|
|
TerminalPhoto first = list.get(0);
|
|
|
|
|
long firstrecv = first.getRecvTime().longValue();
|
|
|
|
|
result.setFirstRecvTime(new Date(firstrecv * 1000));
|
|
|
|
|
long firstphoto = first.getPhotoTime().longValue();
|
|
|
|
|
result.setFirstPhotoTime(new Date(firstphoto * 1000));
|
|
|
|
|
result.setFirstChannelId(first.getChannelId());
|
|
|
|
|
result.setFirstPhotoPath(photoAddress + first.getPath());
|
|
|
|
|
|
|
|
|
|
long totalDays = DateUtil.getDifferenceInDays(result.getFirstPhotoTime(), result.getLastPhotoTime());
|
|
|
|
|
result.setTotalDays(totalDays);
|
|
|
|
|