|
|
|
@ -35,19 +35,19 @@ import com.hnac.hzinfo.inspect.ai.entity.RobotTaskEntity;
|
|
|
|
|
import com.hnac.hzinfo.inspect.ai.mapper.RobotTaskMapper; |
|
|
|
|
import com.hnac.hzinfo.inspect.ai.service.IRobotTaskService; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.oss.OssTemplate; |
|
|
|
|
import org.springblade.core.oss.model.BladeFile; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.jackson.JsonUtil; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.mqtt.producer.IMqttSender; |
|
|
|
|
import org.springblade.resource.feign.IOssClient; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.mock.web.MockMultipartFile; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -71,7 +71,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
|
|
|
|
@Autowired |
|
|
|
|
IClockService clockService; |
|
|
|
|
@Autowired |
|
|
|
|
OssTemplate ossTemplate; |
|
|
|
|
IOssClient ossTemplate; |
|
|
|
|
@Autowired |
|
|
|
|
ITaskUserService taskUserService; |
|
|
|
|
@Autowired |
|
|
|
@ -358,22 +358,22 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
|
|
|
|
switch (ObjContants.RobotCheckTypeEnum.getType(type)){ |
|
|
|
|
case PICTURE: |
|
|
|
|
/** 拍照 */ |
|
|
|
|
BladeFile bladeFile = ossTemplate.putFile(file); |
|
|
|
|
handlePicData(object, bladeFile.getLink()); |
|
|
|
|
R<BladeFile> bladeFile = ossTemplate.putFile(file); |
|
|
|
|
handlePicData(object, bladeFile.getData().getLink()); |
|
|
|
|
break; |
|
|
|
|
case THERMAL: |
|
|
|
|
/** 热成像 */ |
|
|
|
|
handleThermalData(file, object); |
|
|
|
|
break; |
|
|
|
|
case IDENTIFY: |
|
|
|
|
BladeFile bladeFile2 = ossTemplate.putFile(file); |
|
|
|
|
R<BladeFile> bladeFile2 = ossTemplate.putFile(file); |
|
|
|
|
/** 识别 */ |
|
|
|
|
handleIdentifyData(object, bladeFile2.getLink()); |
|
|
|
|
handleIdentifyData(object, bladeFile2.getData().getLink()); |
|
|
|
|
break; |
|
|
|
|
case VOICE: |
|
|
|
|
/** 声音 */ |
|
|
|
|
BladeFile bladeFile3 = ossTemplate.putFile(file); |
|
|
|
|
handleVoiceData(object, bladeFile3.getLink()); |
|
|
|
|
R<BladeFile> bladeFile3 = ossTemplate.putFile(file); |
|
|
|
|
handleVoiceData(object, bladeFile3.getData().getLink()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -567,8 +567,9 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
|
|
|
|
/** 图片 */ |
|
|
|
|
byte[] picTemp = new byte[ints[3]]; |
|
|
|
|
System.arraycopy(dat, 16 + ints[2], picTemp, 0, ints[3]); |
|
|
|
|
MultipartFile multipartFile=new MockMultipartFile("thermal.png", picTemp); |
|
|
|
|
/** 上传文件 */ |
|
|
|
|
BladeFile bladeFile = ossTemplate.putFile("thermal.png",new ByteArrayInputStream(picTemp)); |
|
|
|
|
BladeFile bladeFile = ossTemplate.putFile( multipartFile).getData(); |
|
|
|
|
picUrl = bladeFile.getLink(); |
|
|
|
|
}catch (Exception ex){ |
|
|
|
|
throw new ServiceException("机器人巡检热成像返回文件格式不正确 —— " + ex.getMessage()); |
|
|
|
|