|
|
@ -26,6 +26,7 @@ import com.jiagutech.mapper.RecordMapper; |
|
|
|
import com.jiagutech.record.RecordTaskHandler; |
|
|
|
import com.jiagutech.record.RecordTaskManager; |
|
|
|
import com.jiagutech.record.RecordTaskProcessor; |
|
|
|
import com.sun.xml.bind.v2.TODO; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.SneakyThrows; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -33,6 +34,8 @@ import org.apache.commons.math3.analysis.function.Max; |
|
|
|
import org.apache.poi.ss.usermodel.HorizontalAlignment; |
|
|
|
import org.apache.poi.ss.usermodel.VerticalAlignment; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.validation.BindException; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
|
|
|
|
|
|
@ -128,9 +131,10 @@ public class RecordServiceImpl implements RecordService { |
|
|
|
List<Float> handleLenList = new ArrayList<>(); |
|
|
|
|
|
|
|
List<ModelPredictResponse> recognitionData = record.getRecognitionData(); |
|
|
|
int size = record.getSize(); |
|
|
|
int scale = record.getScale(); |
|
|
|
Scale scaleDto = record.getScale(); |
|
|
|
//把识别数据进行分类
|
|
|
|
float size = scaleDto.getSize(); |
|
|
|
int scale = scaleDto.getScale(); |
|
|
|
for (ModelPredictResponse item : recognitionData) { |
|
|
|
float len; |
|
|
|
if (size > 0 && scale > 0) { |
|
|
@ -161,7 +165,7 @@ public class RecordServiceImpl implements RecordService { |
|
|
|
contentExcel.setBeakNum(record.getBeakNum()); |
|
|
|
contentExcel.setRapeNum(record.getSiliquaNum()); |
|
|
|
contentExcel.setHandleNum(record.getHandleNum()); |
|
|
|
contentExcel.setScale(record.getScale()); |
|
|
|
contentExcel.setScale(scale); |
|
|
|
contentExcel.setConf(record.getConf()); |
|
|
|
contentExcel.setIou(record.getIou()); |
|
|
|
//需要合并的列结束
|
|
|
@ -283,4 +287,49 @@ public class RecordServiceImpl implements RecordService { |
|
|
|
public RecordModel getModels() { |
|
|
|
return recognitionModelClient.models(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void updateScale(UpdateScaleRequest request) { |
|
|
|
QueryWrapper<RecordContentEntity> queryWrapper = Wrappers.query(); |
|
|
|
RecordContentEntity own = null; |
|
|
|
RecordContentEntity other = null; |
|
|
|
switch (request.getScaleType()) { |
|
|
|
case 1: |
|
|
|
own = new RecordContentEntity(); |
|
|
|
own.setScale(request.getScale()); |
|
|
|
own.setScaleType(request.getScaleType()); |
|
|
|
own.setId(request.getRecordContentId()); |
|
|
|
other = new RecordContentEntity().setScale(request.getScale()); |
|
|
|
queryWrapper.eq("record_id", request.getRecordId()); |
|
|
|
queryWrapper.eq("scale_type", 3); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
own = recordContentMapper.selectById(request.getRecordContentId()); |
|
|
|
if (own.getScaleType() == 1) { |
|
|
|
queryWrapper.eq("record_id", own.getRecordId()); |
|
|
|
queryWrapper.eq("scale_type", 3); |
|
|
|
other = new RecordContentEntity().setScaleType(0).setScale(null); |
|
|
|
} |
|
|
|
own.setScale(request.getScale()); |
|
|
|
own.setScaleType(request.getScaleType()); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
default: |
|
|
|
own = new RecordContentEntity().setScaleType(3); |
|
|
|
queryWrapper.eq("record_id", request.getRecordId()); |
|
|
|
queryWrapper.eq("scale_type", 1); |
|
|
|
RecordContentEntity recordContentEntity = recordContentMapper.selectOne(queryWrapper); |
|
|
|
if (recordContentEntity != null) { |
|
|
|
own.setScale(recordContentEntity.getScale()); |
|
|
|
} |
|
|
|
own.setId(request.getRecordContentId()); |
|
|
|
|
|
|
|
} |
|
|
|
recordContentMapper.updateById(own); |
|
|
|
if (other != null) { |
|
|
|
recordContentMapper.update(other, queryWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|