设备补召优化
This commit is contained in:
@@ -240,8 +240,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
queryWrapper.orderBy(true, false, "create_time");
|
queryWrapper.orderBy(true, false, "create_time");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println(StrUtil.isNotBlank(queryParam.getDevType()));
|
|
||||||
System.out.println(!Objects.isNull(queryParam.getDevType()));
|
|
||||||
if (StrUtil.isNotBlank(queryParam.getDevType()) && !Objects.isNull(queryParam.getDevType())){
|
if (StrUtil.isNotBlank(queryParam.getDevType()) && !Objects.isNull(queryParam.getDevType())){
|
||||||
queryWrapper.eq("cs_equipment_delivery.dev_type", queryParam.getDevType());
|
queryWrapper.eq("cs_equipment_delivery.dev_type", queryParam.getDevType());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,11 +68,7 @@ public class DeviceFtpServiceImpl implements DeviceFtpService {
|
|||||||
redisUtil.delete(AppRedisKey.PROJECT_INFO + nDid);
|
redisUtil.delete(AppRedisKey.PROJECT_INFO + nDid);
|
||||||
// 请求设备文件或目录信息
|
// 请求设备文件或目录信息
|
||||||
askDeviceDataFeignClient.askDeviceFileOrDir(nDid, name);
|
askDeviceDataFeignClient.askDeviceFileOrDir(nDid, name);
|
||||||
if (name.contains("comtrade")) {
|
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
} else {
|
|
||||||
Thread.sleep(5000);
|
|
||||||
}
|
|
||||||
// 从 Redis 获取对象
|
// 从 Redis 获取对象
|
||||||
Object object = redisUtil.getObjectByKey(AppRedisKey.PROJECT_INFO + nDid);
|
Object object = redisUtil.getObjectByKey(AppRedisKey.PROJECT_INFO + nDid);
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class OfflineDataUploadController extends BaseController {
|
|||||||
@PostMapping(value = "/makeUp")
|
@PostMapping(value = "/makeUp")
|
||||||
@ApiOperation("设备补招")
|
@ApiOperation("设备补招")
|
||||||
@ApiImplicitParam(name = "param", value = "补招参数", required = true)
|
@ApiImplicitParam(name = "param", value = "补招参数", required = true)
|
||||||
public HttpResult<List<MakeUpVo>> makeUp(@RequestBody MakeUpParam param) {
|
public HttpResult<String> makeUp(@RequestBody MakeUpParam param) {
|
||||||
String methodDescribe = getMethodDescribe("makeUp");
|
String methodDescribe = getMethodDescribe("makeUp");
|
||||||
offlineDataUploadService.startMakeUpData(param);
|
offlineDataUploadService.startMakeUpData(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.csharmonic.controller;
|
||||||
|
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:治理实时数据
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2024/9/30
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/realData")
|
||||||
|
@Api(tags = "实时数据")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RealDataController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import com.njcn.access.utils.MqttUtil;
|
|||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.DeviceFtpFeignClient;
|
import com.njcn.csdevice.api.DeviceFtpFeignClient;
|
||||||
|
import com.njcn.csdevice.api.PortableOffLogFeignClient;
|
||||||
import com.njcn.csharmonic.enums.CsHarmonicResponseEnum;
|
import com.njcn.csharmonic.enums.CsHarmonicResponseEnum;
|
||||||
import com.njcn.csharmonic.offline.constant.OfflineConstant;
|
import com.njcn.csharmonic.offline.constant.OfflineConstant;
|
||||||
import com.njcn.csharmonic.offline.log.Log;
|
import com.njcn.csharmonic.offline.log.Log;
|
||||||
@@ -72,6 +73,8 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
private final DeviceFtpFeignClient deviceFtpFeignClient;
|
private final DeviceFtpFeignClient deviceFtpFeignClient;
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
private final GeneralInfo generalInfo;
|
private final GeneralInfo generalInfo;
|
||||||
|
private final PortableOffLogFeignClient portableOffLogFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception{
|
public byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception{
|
||||||
@@ -138,7 +141,7 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
try {
|
try {
|
||||||
//询问装置项目信息
|
//询问装置项目信息
|
||||||
askProjectInfo(lineId,null, Integer.parseInt(TypeEnum.TYPE_6.getCode()),null,"DevCmd");
|
askProjectInfo(lineId,null, Integer.parseInt(TypeEnum.TYPE_6.getCode()),null,"DevCmd");
|
||||||
Thread.sleep(2000);
|
Thread.sleep(5000);
|
||||||
String key = AppRedisKey.PROJECT_INFO + lineId;
|
String key = AppRedisKey.PROJECT_INFO + lineId;
|
||||||
Object object = redisUtil.getObjectByKey(key);
|
Object object = redisUtil.getObjectByKey(key);
|
||||||
if (!Objects.isNull(object)) {
|
if (!Objects.isNull(object)) {
|
||||||
@@ -270,7 +273,7 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
}
|
}
|
||||||
askFileInfo(param.getNDid(),mid,item);
|
askFileInfo(param.getNDid(),mid,item);
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(5000);
|
||||||
FileDto.FileInfo info = channelObjectUtil.objectToSingleObject(redisUtil.getObjectByKey(key),FileDto.FileInfo.class);
|
FileDto.FileInfo info = channelObjectUtil.objectToSingleObject(redisUtil.getObjectByKey(key),FileDto.FileInfo.class);
|
||||||
String path = deviceFtpFeignClient.downloadFile(param.getNDid(),item,info.getFileSize(),info.getFileCheck()).getData();
|
String path = deviceFtpFeignClient.downloadFile(param.getNDid(),item,info.getFileSize(),info.getFileCheck()).getData();
|
||||||
String lsFile = generalInfo.getBusinessTempPath() + File.separator + item.split(StrUtil.SLASH)[item.split(StrUtil.SLASH).length - 1];
|
String lsFile = generalInfo.getBusinessTempPath() + File.separator + item.split(StrUtil.SLASH)[item.split(StrUtil.SLASH).length - 1];
|
||||||
@@ -281,18 +284,13 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
//删除下载文件
|
//删除下载文件
|
||||||
//fileStorageUtil.deleteFile(path);
|
fileStorageUtil.deleteFile(path);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(CsHarmonicResponseEnum.MAKE_UP_ERROR);
|
throw new BusinessException(CsHarmonicResponseEnum.MAKE_UP_ERROR);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//推送消息,按照离线数据方式处理
|
//下载完成,调用解析接口
|
||||||
MakeUpDto.FileInfo dto = new MakeUpDto.FileInfo();
|
portableOffLogFeignClient.dataOnlineRecruitment(param.getNDid(),param.getLineId(),proName);
|
||||||
dto.setProName(proName);
|
|
||||||
dto.setNDid(param.getNDid());
|
|
||||||
dto.setLineId(param.getLineId());
|
|
||||||
dto.setFileList(v);
|
|
||||||
publisher.send("/Web/makeUp/" + param.getLineId(), new Gson().toJson(dto), 1, false);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,8 +329,10 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
LocalDate endDate = LocalDate.parse(endTime, formatter);
|
LocalDate endDate = LocalDate.parse(endTime, formatter);
|
||||||
LocalDate targetDate = LocalDate.parse(data, formatterNoDelimiter);
|
LocalDate targetDate = LocalDate.parse(data, formatterNoDelimiter);
|
||||||
if (!targetDate.isBefore(startDate) && !targetDate.isAfter(endDate)) {
|
if (!targetDate.isBefore(startDate) && !targetDate.isAfter(endDate)) {
|
||||||
log.info("日期在指定范围内");
|
log.info("{},日期在指定范围内",data);
|
||||||
result = true;
|
result = true;
|
||||||
|
} else {
|
||||||
|
log.info("{},日期不在指定范围内",data);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user