报告设备类型调整
This commit is contained in:
@@ -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.pojo.enums.SceneEnum;
|
||||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
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.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.IDictDataService;
|
||||||
|
import com.njcn.gather.system.dictionary.service.IDictTypeService;
|
||||||
import com.njcn.gather.type.pojo.po.DevType;
|
import com.njcn.gather.type.pojo.po.DevType;
|
||||||
import com.njcn.gather.type.service.IDevTypeService;
|
import com.njcn.gather.type.service.IDevTypeService;
|
||||||
import com.njcn.http.util.RestTemplateUtil;
|
import com.njcn.http.util.RestTemplateUtil;
|
||||||
@@ -161,9 +163,13 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
@Value("${report.dateFormat}")
|
@Value("${report.dateFormat}")
|
||||||
private String dateFormat;
|
private String dateFormat;
|
||||||
|
|
||||||
|
// 设备出厂装置型号字典对应的code
|
||||||
|
private final String EX_FACTORY_DEV_TYPE = "Ex-factory_Dev_Type";
|
||||||
|
|
||||||
private final IPqDevService iPqDevService;
|
private final IPqDevService iPqDevService;
|
||||||
private final PqDevMapper pqDevMapper;
|
private final PqDevMapper pqDevMapper;
|
||||||
|
|
||||||
|
private final IDictTypeService dictTypeService;
|
||||||
private final IDictDataService dictDataService;
|
private final IDictDataService dictDataService;
|
||||||
|
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
@@ -1426,6 +1432,17 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
Map<String, String> baseModelMap = new HashMap<>(32);
|
Map<String, String> baseModelMap = new HashMap<>(32);
|
||||||
// 获取设备型号
|
// 获取设备型号
|
||||||
baseModelMap.put(prefix + BaseReportKeyEnum.DEV_TYPE.getKey() + suffix, devType.getName());
|
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() + "");
|
baseModelMap.put(prefix + BaseReportKeyEnum.INSPECTOR.getKey() + suffix, pqDevVO.getCheckBy() + "");
|
||||||
String datePattern = DatePattern.NORM_DATE_PATTERN;
|
String datePattern = DatePattern.NORM_DATE_PATTERN;
|
||||||
|
|||||||
Reference in New Issue
Block a user