Browse Source

fix:翻译

master
wangguangyuan 8 months ago
parent
commit
5e1fbdd65d
4 changed files with 55 additions and 11 deletions
  1. +8
    -4
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalysisServiceImpl.java
  2. +6
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java
  3. +11
    -5
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  4. +30
    -2
      inspect-metadata/src/main/java/com/inspect/metadata/alg/controller/BasedataAlgSubtypeController.java

+ 8
- 4
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalysisServiceImpl.java View File

@ -17,6 +17,7 @@ import com.inspect.base.core.utils.DateUtils;
import com.inspect.base.core.utils.StringUtils;
import com.inspect.base.redis.service.RedisService;
import com.inspect.common.security.utils.DictUtils;
import com.inspect.message.MessageUtils;
import com.inspect.partrolresult.domain.AnalyseRequest;
import com.inspect.partrolresult.domain.PatrolResult;
import com.inspect.partrolresult.service.AnalyseRemoteService;
@ -64,6 +65,9 @@ public class AnalysisServiceImpl implements IAnalysisService {
@Resource
private IPatrolTaskInfoService patrolTaskInfoService;
@Resource
private MessageUtils messageUtils;
@Override
public void picAnalyseRetNotify(AnalyseResult analyseResult) {
log.info(Color.CYAN + "###### 分析算法模块返回的表计识别结果 start, analyseResult:{} ######" + Color.END, analyseResult);
@ -319,9 +323,9 @@ public class AnalysisServiceImpl implements IAnalysisService {
if (StringUtils.isNotEmpty(isAlgType) && isAlgType.equals("1")) {
if (resultAnalysis.getResultType().equals("1")) {
patrolResult.setValueUnit("无缺陷");
patrolResult.setValueUnit(messageUtils.get("无缺陷"));
} else {
patrolResult.setValueUnit("有缺陷");
patrolResult.setValueUnit(messageUtils.get("有缺陷"));
}
}
@ -687,10 +691,10 @@ public class AnalysisServiceImpl implements IAnalysisService {
return "1".equals(item.getResultType());
}).count();
if (alarmCount > 0L) {
patrolResult.setValueUnit("有缺陷");
patrolResult.setValueUnit(messageUtils.get("有缺陷"));
websocketDataList.add(new WebsocketData(resItem.getObjectId(), patrolResult.getValueUnit()));
} else {
patrolResult.setValueUnit("无缺陷");
patrolResult.setValueUnit(messageUtils.get("无缺陷"));
}
}


+ 6
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java View File

@ -182,6 +182,12 @@ public class MessageUtils {
return "judgeAbnormal";
case "数据对比分析":
return "analysis";
case "有缺陷":
return "defects";
case "无缺陷":
return "noDefects";
case "总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。":
return "Total points: %d, checked points: %d, unchecked points: 0, normal points: %d, abnormal points: %d, manual confirmation points: %d.";
default:
return key;
}


+ 11
- 5
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java View File

@ -15,6 +15,7 @@ import com.inspect.insreport.domain.InspectionReport;
import com.inspect.insreport.mapper.InspectionReportMapper;
import com.inspect.insreportdata.domain.InspectionReportData;
import com.inspect.insreportdata.mapper.InspectionReportDataMapper;
import com.inspect.message.MessageUtils;
import com.inspect.partrolresult.domain.*;
import com.inspect.partrolresult.mapper.PatrolResultMapper;
import com.inspect.partrolresult.service.IPatrolResultService;
@ -38,6 +39,7 @@ import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -60,6 +62,9 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
private final InspectionReportDataMapper inspectionReportDataMapper;
private final ResultAnalysisMapper resultAnalysisMapper;
@Autowired
private MessageUtils messageUtils;
public PatrolResultServiceImpl(PatrolResultMapper patrolResultMapper, PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper, PatrolTaskResultMainMapper patrolTaskResultMainMapper, PatrolTaskStatusMapper patrolTaskStatusMapper, PatrolTaskMapper patrolTaskMapper, InspectionReportMapper inspectionReportMapper, InspectionReportImgMapper inspectionReportImgMapper, InspectionReportDataMapper inspectionReportDataMapper, ResultAnalysisMapper resultAnalysisMapper) {
this.patrolResultMapper = patrolResultMapper;
this.patrolResultDefaultvalueMapper = patrolResultDefaultvalueMapper;
@ -422,7 +427,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
reportData.setEqName(basePointAreaInfo.getMainName());
reportData.setParts(basePointAreaInfo.getDeviceName());
reportData.setPointName(basePointAreaInfo.getPatrolPointName());
reportData.setDataSources("0".equals(devType) ? "无人机" : "1".equals(devType) ? "机器人" : "高清视频");
reportData.setDataSources("0".equals(devType) ? messageUtils.get("无人机") : "1".equals(devType) ? messageUtils.get("机器人") : messageUtils.get("高清视频"));
reportData.setAcquisitionTime(DateUtils.parse(DateUtils.yyyyMMddHHmmss2, patrolResultRef.getTime()));
reportData.setInspectionResults(patrolResultRef.getDescription());
String threshold = patrolResultRef.getThreshold();
@ -446,15 +451,15 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
if(pointStatus == null) {
continue;
} else if (pointStatus.equals("0")) {
reportData.setPointStatus("异常");
reportData.setPointStatus(messageUtils.get("异常"));
reportData.setCode(failNum);
++failNum;
} else if (pointStatus.equals("1")) {
reportData.setPointStatus("待人工确认");
reportData.setPointStatus(messageUtils.get("待人工确认"));
reportData.setCode(confirmNum);
++confirmNum;
} else {
reportData.setPointStatus("正常");
reportData.setPointStatus(messageUtils.get("正常"));
reportData.setCode(okNum);
++okNum;
}
@ -526,7 +531,8 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
okNum = lastNum;
}
return String.format("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。", totalNum, totalNum, okNum, failNum, confirmNum);
// return String.format("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。", totalNum, totalNum, okNum, failNum, confirmNum);
return String.format(messageUtils.get("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。"), totalNum, totalNum, okNum, failNum, confirmNum);
}
public List<PatrolResultRef> selectResultRefByLineId(String mainId) {


+ 30
- 2
inspect-metadata/src/main/java/com/inspect/metadata/alg/controller/BasedataAlgSubtypeController.java View File

@ -1,6 +1,10 @@
package com.inspect.metadata.alg.controller;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.inspect.base.core.text.Convert;
import com.inspect.base.core.utils.ServletUtils;
import com.inspect.base.core.web.page.TableSupport;
import com.inspect.metadata.alg.domain.BasedataAlg;
import com.inspect.metadata.alg.domain.BasedataAlgSubtype;
import com.inspect.metadata.alg.service.IBasedataAlgService;
@ -14,8 +18,10 @@ import com.inspect.common.log.enums.BizType;
import com.inspect.common.security.annotation.RequiresPermissions;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -37,8 +43,12 @@ public class BasedataAlgSubtypeController extends BaseController {
@RequiresPermissions({"basedata:subtype:list"})
@GetMapping({"/list"})
public TableDataInfo list(BasedataAlgSubtype basedataAlgSubtype) {
this.startPage();
logger.info("-------参数----basedataAlgSubtype:{}", basedataAlgSubtype);
if (basedataAlgSubtype != null && StringUtils.isEmpty(basedataAlgSubtype.getAlgName())) {
this.startPage();
}
List<BasedataAlgSubtype> list = this.basedataAlgSubtypeService.selectBasedataAlgSubtypeList(basedataAlgSubtype);
logger.info("-----------list:{}", list);
if (null != list && !list.isEmpty()) {
for (BasedataAlgSubtype bs : list) {
Long algId = bs.getAlgId();
@ -46,11 +56,29 @@ public class BasedataAlgSubtypeController extends BaseController {
BasedataAlg alg = this.basedataAlgService.selectBasedataAlgByAlgId(algId);
if (null != alg) {
bs.setAlgName(alg.getAlgName());
} else {
bs.setAlgName("");
}
}
}
if (basedataAlgSubtype != null && StringUtils.isNotEmpty(basedataAlgSubtype.getAlgName())) {
logger.info("-----------algName:{}", basedataAlgSubtype.getAlgName());
list = list.stream().filter(item -> item.getAlgName().contains(basedataAlgSubtype.getAlgName())).collect(Collectors.toList());
logger.info("-----------list:{}", list);
int pageNum = Convert.toInt(ServletUtils.getParameter(TableSupport.PAGE_NUM), 1);
int pageSize = Convert.toInt(ServletUtils.getParameter(TableSupport.PAGE_SIZE), 10);
int fromIndex = (pageNum - 1) * pageSize;
int toIndex = Math.min(fromIndex + pageSize, list.size());
List<BasedataAlgSubtype> rowList = list.subList(fromIndex, toIndex);
logger.info("-----------rowList:{}", rowList);
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(200);
rspData.setRows(rowList);
rspData.setMsg("Query Ok");
rspData.setTotal(list.size());
return rspData;
}
}
return this.getDataTable(list);
}


Loading…
Cancel
Save