|
|
@@ -211,29 +211,33 @@ public class TrialSummaryClassificationConfigurationController extends BladeCont
|
|
|
@RequestMapping(value = "/input/detail", method = RequestMethod.GET)
|
|
|
public R<Object> inputDetail(@RequestParam String classId, @RequestParam String keyName) {
|
|
|
TrialSummaryClassificationConfiguration classificationConfiguration = iTrialSummaryClassificationConfigurationService.getById(classId);
|
|
|
+ List<Map<String, String>> r=new ArrayList<>();
|
|
|
if (classificationConfiguration != null && ObjectUtil.isNotEmpty(classificationConfiguration.getExcelId())) {
|
|
|
String sql = "SELECT * FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ? AND html_key_name = ?";
|
|
|
- TrialSummaryExcelTabReflection obj = jdbcTemplate.query(sql, new Object[]{classificationConfiguration.getExcelId(), keyName}, new BeanPropertyRowMapper<>(TrialSummaryExcelTabReflection.class)).stream().findAny().orElse(null);
|
|
|
- if (obj != null) {
|
|
|
- if (TrialTableDataInfo.LONG_ID.equals(obj.getTrialTabId())) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("id", obj.getId().toString());
|
|
|
- map.put("tabName", TrialTableDataInfo.TBN_CH);
|
|
|
- map.put("elementName", TrialTableDataInfo.getElementName(obj.getElementKey()));
|
|
|
- return R.data(map);
|
|
|
- }
|
|
|
- WbsTreePrivate trialTab = wbsTreePrivateServiceImpl.getBaseMapper().getByPKeyId(obj.getTrialTabId());
|
|
|
- WbsFormElement element = wbsFormElementService.getById(obj.getElementId());
|
|
|
- if (trialTab != null && element != null) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("id", obj.getId().toString());
|
|
|
- map.put("tabName", ObjectUtil.isNotEmpty(trialTab.getFullName()) ? trialTab.getFullName() : trialTab.getNodeName());
|
|
|
- map.put("elementName", element.getEName());
|
|
|
- return R.data(map);
|
|
|
+ List<TrialSummaryExcelTabReflection> list = jdbcTemplate.query(sql, new Object[]{classificationConfiguration.getExcelId(), keyName}, new BeanPropertyRowMapper<>(TrialSummaryExcelTabReflection.class));
|
|
|
+ if (list != null) {
|
|
|
+ for (TrialSummaryExcelTabReflection obj : list) {
|
|
|
+ if (TrialTableDataInfo.LONG_ID.equals(obj.getTrialTabId())) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("id", obj.getId().toString());
|
|
|
+ map.put("tabName", TrialTableDataInfo.TBN_CH);
|
|
|
+ map.put("elementName", TrialTableDataInfo.getElementName(obj.getElementKey()));
|
|
|
+ r.add( map);
|
|
|
+ }else {
|
|
|
+ WbsTreePrivate trialTab = wbsTreePrivateServiceImpl.getBaseMapper().getByPKeyId(obj.getTrialTabId());
|
|
|
+ WbsFormElement element = wbsFormElementService.getById(obj.getElementId());
|
|
|
+ if (trialTab != null && element != null) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("id", obj.getId().toString());
|
|
|
+ map.put("tabName", ObjectUtil.isNotEmpty(trialTab.getFullName()) ? trialTab.getFullName() : trialTab.getNodeName());
|
|
|
+ map.put("elementName", element.getEName());
|
|
|
+ r.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return R.data(null);
|
|
|
+ return R.data(r);
|
|
|
}
|
|
|
|
|
|
@ApiOperationSupport(order = 13)
|
|
|
@@ -255,12 +259,12 @@ public class TrialSummaryClassificationConfigurationController extends BladeCont
|
|
|
throw new ServiceException("入参异常,未获取到htmlKeyName");
|
|
|
}
|
|
|
|
|
|
- String sqlDel = "DELETE FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ? AND class_id = ? AND html_key_name IN (" +
|
|
|
- StringUtils.join(keyNameList, ",") + ")";
|
|
|
- List<Object> paramsDel = new ArrayList<>();
|
|
|
- paramsDel.add(classificationConfiguration.getExcelId());
|
|
|
- paramsDel.add(classificationConfiguration.getId());
|
|
|
- jdbcTemplate.update(sqlDel, paramsDel.toArray());
|
|
|
+// String sqlDel = "DELETE FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ? AND class_id = ? AND html_key_name IN (" +
|
|
|
+// StringUtils.join(keyNameList, ",") + ")";
|
|
|
+// List<Object> paramsDel = new ArrayList<>();
|
|
|
+// paramsDel.add(classificationConfiguration.getExcelId());
|
|
|
+// paramsDel.add(classificationConfiguration.getId());
|
|
|
+// jdbcTemplate.update(sqlDel, paramsDel.toArray());
|
|
|
|
|
|
String sqlInsert = "INSERT INTO m_trial_summary_excel_tab_reflection(id,class_id,excel_id,trial_tab_id,element_id,html_key_name,trial_tab_name,element_key) VALUES (?,?,?,?,?,?,?,?)";
|
|
|
List<Object[]> batchArgs = new ArrayList<>();
|