|
@@ -51,10 +51,22 @@ public class DataAcquisitionInstrumentController {
|
51
|
51
|
volits.setSize(pageList.getSize());
|
52
|
52
|
List<DataAcquisitionInstrument> records = pageList.getRecords();
|
53
|
53
|
List<DataAcquisitionInstrumentVo> revoList = new ArrayList<>();
|
|
54
|
+ // 查询企业
|
|
55
|
+ Map<String,Object> componyMap = dataAcquisitionInstrumentService.getComponyMap();
|
|
56
|
+ // 查询工厂
|
|
57
|
+ Map<String, Object> departmentMap = dataAcquisitionInstrumentService.getDepartmentMap();
|
54
|
58
|
records.forEach(x->{
|
55
|
59
|
DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
|
56
|
60
|
List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(x.getId());
|
57
|
61
|
BeanUtils.copyProperties(x, instrumentVo);
|
|
62
|
+ if (instrumentVo.getCompanyCode()!=null && componyMap.get(instrumentVo.getCompanyCode())!=null){
|
|
63
|
+ Map componyMapobj = (Map)componyMap.get(instrumentVo.getCompanyCode());
|
|
64
|
+ instrumentVo.setCompanyName(componyMapobj.get("companylongname").toString());
|
|
65
|
+ }
|
|
66
|
+ if (instrumentVo.getDepartmentCode()!=null && departmentMap.get(instrumentVo.getDepartmentCode())!=null){
|
|
67
|
+ Map componyMapobj = (Map)departmentMap.get(instrumentVo.getDepartmentCode());
|
|
68
|
+ instrumentVo.setDepartmentName(componyMapobj.get("departmentname").toString());
|
|
69
|
+ };
|
58
|
70
|
if (!analyticalInstruments.isEmpty()){
|
59
|
71
|
List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
|
60
|
72
|
analyticalInstruments.forEach(y->{
|
|
@@ -81,7 +93,7 @@ public class DataAcquisitionInstrumentController {
|
81
|
93
|
* 根据菜单编号获取详细信息
|
82
|
94
|
*/
|
83
|
95
|
@GetMapping(value = "delete/{id}")
|
84
|
|
- public AjaxResult getInfo(@PathVariable String id)
|
|
96
|
+ public AjaxResult delete(@PathVariable String id)
|
85
|
97
|
{
|
86
|
98
|
DataAcquisitionInstrument dataAcquisitionInstrument = dataAcquisitionInstrumentService.getById(id);
|
87
|
99
|
DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
|
|
@@ -100,6 +112,37 @@ public class DataAcquisitionInstrumentController {
|
100
|
112
|
}
|
101
|
113
|
}
|
102
|
114
|
dataAcquisitionInstrumentService.remove(new QueryWrapper<DataAcquisitionInstrument>().eq("id", id));
|
|
115
|
+ return success();
|
|
116
|
+ }
|
|
117
|
+
|
|
118
|
+ /**
|
|
119
|
+ * 根据菜单编号获取详细信息
|
|
120
|
+ */
|
|
121
|
+ @GetMapping(value = "/{id}")
|
|
122
|
+ public AjaxResult getInfo(@PathVariable String id)
|
|
123
|
+ {
|
|
124
|
+ DataAcquisitionInstrument dataAcquisitionInstrument = dataAcquisitionInstrumentService.getById(id);
|
|
125
|
+ DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
|
|
126
|
+ if (dataAcquisitionInstrument != null){
|
|
127
|
+ BeanUtils.copyProperties(dataAcquisitionInstrument, instrumentVo);
|
|
128
|
+ List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(dataAcquisitionInstrument.getId());
|
|
129
|
+ if (!analyticalInstruments.isEmpty()){
|
|
130
|
+ List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
|
|
131
|
+ analyticalInstruments.forEach(x->{
|
|
132
|
+ AnalyticalInstrumentsVo analyticalInstrumentsVo = new AnalyticalInstrumentsVo();
|
|
133
|
+ BeanUtils.copyProperties(x, analyticalInstrumentsVo);
|
|
134
|
+
|
|
135
|
+ List<DetectMonitoringFactor> analyticalInstrumentId = detectMonitoringFactorService.listByParentId(x.getId());
|
|
136
|
+ if (!analyticalInstrumentId.isEmpty()){
|
|
137
|
+ analyticalInstrumentId.forEach(z->{
|
|
138
|
+ analyticalInstrumentsVo.getDetectMonitoringFactors().add(z);
|
|
139
|
+ });
|
|
140
|
+ }
|
|
141
|
+ analyticalInstrumentList.add(analyticalInstrumentsVo);
|
|
142
|
+ });
|
|
143
|
+ instrumentVo.setAnalyticalInstruments(analyticalInstrumentList);
|
|
144
|
+ }
|
|
145
|
+ }
|
103
|
146
|
return success(instrumentVo);
|
104
|
147
|
}
|
105
|
148
|
|