报告设备类型调整

This commit is contained in:
caozehui
2025-12-23 15:12:11 +08:00
parent 3f1ae1886a
commit 753a303fec

View File

@@ -65,7 +65,9 @@ import com.njcn.gather.storage.service.AdNonHarmonicService;
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
import com.njcn.gather.system.dictionary.pojo.po.DictData;
import com.njcn.gather.system.dictionary.pojo.po.DictType;
import com.njcn.gather.system.dictionary.service.IDictDataService;
import com.njcn.gather.system.dictionary.service.IDictTypeService;
import com.njcn.gather.type.pojo.po.DevType;
import com.njcn.gather.type.service.IDevTypeService;
import com.njcn.http.util.RestTemplateUtil;
@@ -161,9 +163,13 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
@Value("${report.dateFormat}")
private String dateFormat;
// 设备出厂装置型号字典对应的code
private final String EX_FACTORY_DEV_TYPE = "Ex-factory_Dev_Type";
private final IPqDevService iPqDevService;
private final PqDevMapper pqDevMapper;
private final IDictTypeService dictTypeService;
private final IDictDataService dictDataService;
private final IAdPlanService adPlanService;
@@ -1426,6 +1432,17 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
Map<String, String> baseModelMap = new HashMap<>(32);
// 获取设备型号
baseModelMap.put(prefix + BaseReportKeyEnum.DEV_TYPE.getKey() + suffix, devType.getName());
DictType dictType = dictTypeService.getByCode(EX_FACTORY_DEV_TYPE);
if (ObjectUtil.isNotNull(dictType)) {
List<DictData> dictDataList = dictDataService.getDictDataByTypeId(dictType.getId());
DictData targetDictData = dictDataList.stream().filter(dictData -> dictData.getCode().equals(pqDevVO.getDevType())).findFirst().orElse(null);
if (ObjectUtil.isNotNull(targetDictData)) {
String name = devType.getName();
name = name.substring(0, name.lastIndexOf(StrUtil.C_UNDERLINE));
baseModelMap.put(prefix + BaseReportKeyEnum.DEV_TYPE.getKey() + suffix, name + "(" + targetDictData.getCode() + ")");
}
}
// 检测员
baseModelMap.put(prefix + BaseReportKeyEnum.INSPECTOR.getKey() + suffix, pqDevVO.getCheckBy() + "");
String datePattern = DatePattern.NORM_DATE_PATTERN;