|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.project.tieta.bean.ResultData;
|
|
|
import com.fdkankan.project.tieta.constant.Constant;
|
|
@@ -12,7 +13,9 @@ import com.fdkankan.project.tieta.constant.ServerCode;
|
|
|
import com.fdkankan.project.tieta.dto.ScenePushDTO;
|
|
|
import com.fdkankan.project.tieta.dto.SendConvertDTO;
|
|
|
import com.fdkankan.project.tieta.entity.FullphotoFileindex;
|
|
|
+import com.fdkankan.project.tieta.entity.FullphotoUprecord;
|
|
|
import com.fdkankan.project.tieta.service.FullphotoFileindexService;
|
|
|
+import com.fdkankan.project.tieta.service.FullphotoUprecordService;
|
|
|
import com.fdkankan.project.tieta.service.IConvertService;
|
|
|
import com.fdkankan.redis.util.RedisClient;
|
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
@@ -36,6 +39,8 @@ public class ConvertServiceImpl implements IConvertService {
|
|
|
private FullphotoFileindexService fullphotoFileindexService;
|
|
|
@Resource
|
|
|
private RedisClient redisClient;
|
|
|
+ @Autowired
|
|
|
+ FullphotoUprecordService fullphotoUprecordService;
|
|
|
|
|
|
@Override
|
|
|
public void sendConvert(SendConvertDTO dto) {
|
|
@@ -51,7 +56,14 @@ public class ConvertServiceImpl implements IConvertService {
|
|
|
playload.put("stationCode", dto.getStationCode());
|
|
|
playload.put("entityId", dto.getEntityId());
|
|
|
playload.put("upTime", DateUtil.format(dto.getUpTime(), DatePattern.NORM_DATETIME_PATTERN));
|
|
|
- List<FullphotoFileindex> fullphotoFileindices = fullphotoFileindexService.listByStationCodeAndEntityId(dto.getStationCode(), dto.getEntityId());
|
|
|
+ if(StrUtil.isNotEmpty(convertType)){
|
|
|
+ playload.put("convertType", convertType);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(convertType) && convertType.equals("upTime")){//只更新上传时间,直接发送,不需要查文件列表数据
|
|
|
+ mqProducer.sendByWorkQueue(Constant.QUEUE_SCENE_CONVERT, playload);
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+ List<FullphotoFileindex> fullphotoFileindices = fullphotoFileindexService.listByUploadId(dto.getUploadId());
|
|
|
if(CollUtil.isEmpty(fullphotoFileindices)){
|
|
|
return ResultData.error(ServerCode.RESOURCE_NOT_EXIST);
|
|
|
}
|
|
@@ -63,9 +75,6 @@ public class ConvertServiceImpl implements IConvertService {
|
|
|
return item;
|
|
|
}).collect(Collectors.toList());
|
|
|
playload.put("fileList", fileList);
|
|
|
- if(StrUtil.isNotEmpty(convertType)){
|
|
|
- playload.put("convertType", convertType);
|
|
|
- }
|
|
|
mqProducer.sendByWorkQueue(Constant.QUEUE_SCENE_CONVERT, playload);
|
|
|
return ResultData.ok();
|
|
|
}
|
|
@@ -101,4 +110,35 @@ public class ConvertServiceImpl implements IConvertService {
|
|
|
current++;
|
|
|
}while (fullphotoFileindexPage.hasNext());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void pushOldHistory() {
|
|
|
+ List<FullphotoUprecord> list = fullphotoUprecordService.list(new LambdaQueryWrapper<FullphotoUprecord>().select(FullphotoUprecord::getStationCode, FullphotoUprecord::getEntityId).groupBy(FullphotoUprecord::getStationCode, FullphotoUprecord::getEntityId));
|
|
|
+ for (FullphotoUprecord fullphotoUprecord : list) {
|
|
|
+
|
|
|
+ List<FullphotoUprecord> list1 = fullphotoUprecordService.list(
|
|
|
+ new LambdaQueryWrapper<FullphotoUprecord>()
|
|
|
+ .eq(FullphotoUprecord::getStationCode, fullphotoUprecord.getStationCode())
|
|
|
+ .eq(FullphotoUprecord::getEntityId, fullphotoUprecord.getEntityId())
|
|
|
+ .orderByDesc(FullphotoUprecord::getUpTime));
|
|
|
+
|
|
|
+ for(int i = 0; i < list1.size(); i++){
|
|
|
+ FullphotoUprecord fullphotoUprecord1 = list1.get(i);
|
|
|
+ ScenePushDTO scenePushDTO = new ScenePushDTO();
|
|
|
+ scenePushDTO.setStationCode(fullphotoUprecord1.getStationCode());
|
|
|
+ scenePushDTO.setEntityId(fullphotoUprecord1.getEntityId());
|
|
|
+ scenePushDTO.setUpTime(fullphotoUprecord1.getUpTime());
|
|
|
+ scenePushDTO.setUploadId(fullphotoUprecord1.getUploadId());
|
|
|
+ String convertType = null;
|
|
|
+ if(i == 0){
|
|
|
+ convertType = "upTime";//默认vr系统已经是
|
|
|
+ }else{
|
|
|
+ convertType = "old";
|
|
|
+ }
|
|
|
+ this.scenePush(scenePushDTO, convertType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|