|
@@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@@ -234,17 +235,19 @@ public class TrialSummaryClassificationConfigurationController extends BladeCont
|
|
throw new ServiceException("入参异常,未获取到htmlKeyName");
|
|
throw new ServiceException("入参异常,未获取到htmlKeyName");
|
|
}
|
|
}
|
|
|
|
|
|
- String sqlDel = "DELETE FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ? AND html_key_name IN (" +
|
|
|
|
|
|
+ String sqlDel = "DELETE FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ? AND class_id = ? AND html_key_name IN (" +
|
|
StringUtils.join(keyNameList, ",") + ")";
|
|
StringUtils.join(keyNameList, ",") + ")";
|
|
List<Object> paramsDel = new ArrayList<>();
|
|
List<Object> paramsDel = new ArrayList<>();
|
|
paramsDel.add(classificationConfiguration.getExcelId());
|
|
paramsDel.add(classificationConfiguration.getExcelId());
|
|
|
|
+ paramsDel.add(classificationConfiguration.getId());
|
|
jdbcTemplate.update(sqlDel, paramsDel.toArray());
|
|
jdbcTemplate.update(sqlDel, paramsDel.toArray());
|
|
|
|
|
|
- String sqlInsert = "INSERT INTO m_trial_summary_excel_tab_reflection(id,excel_id,trial_tab_id,element_id,html_key_name,trial_tab_name,element_key) VALUES (?,?,?,?,?,?,?)";
|
|
|
|
|
|
+ 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<>();
|
|
List<Object[]> batchArgs = new ArrayList<>();
|
|
for (TrialSummaryReflectionSaveDTO.ReflectionBean reflectionBean : collect) {
|
|
for (TrialSummaryReflectionSaveDTO.ReflectionBean reflectionBean : collect) {
|
|
Object[] paramsInsert = {
|
|
Object[] paramsInsert = {
|
|
SnowFlakeUtil.getId(),
|
|
SnowFlakeUtil.getId(),
|
|
|
|
+ classificationConfiguration.getId(),
|
|
classificationConfiguration.getExcelId(),
|
|
classificationConfiguration.getExcelId(),
|
|
reflectionBean.getTrialTabId(),
|
|
reflectionBean.getTrialTabId(),
|
|
reflectionBean.getElementId(),
|
|
reflectionBean.getElementId(),
|
|
@@ -275,4 +278,31 @@ public class TrialSummaryClassificationConfigurationController extends BladeCont
|
|
return R.fail("操作失败");
|
|
return R.fail("操作失败");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperationSupport(order = 15)
|
|
|
|
+ @ApiOperation(value = "获取当前清表表所有已匹配的映射字段列表", notes = "传入/page接口的id")
|
|
|
|
+ @RequestMapping(value = "/reflection/html/data", method = RequestMethod.GET)
|
|
|
|
+ public R<List<Map<String, Object>>> reflectionHtmlData(@RequestParam String id) {
|
|
|
|
+ List<Map<String, Object>> maps = new LinkedList<>();
|
|
|
|
+ if (ObjectUtil.isNotEmpty(id)) {
|
|
|
|
+ TrialSummaryClassificationConfiguration clazz = iTrialSummaryClassificationConfigurationService.getById(id);
|
|
|
|
+ if (clazz != null) {
|
|
|
|
+ List<TrialSummaryExcelTabReflection> query = jdbcTemplate.query("SELECT * FROM m_trial_summary_excel_tab_reflection WHERE class_id = ?", new Object[]{id}, new BeanPropertyRowMapper<>(TrialSummaryExcelTabReflection.class));
|
|
|
|
+ if (query.size() > 0) {
|
|
|
|
+ Set<Long> eleIds = query.stream().map(TrialSummaryExcelTabReflection::getElementId).collect(Collectors.toSet());
|
|
|
|
+ Map<Long, WbsFormElement> eleMap = wbsFormElementService.getBaseMapper().selectBatchIds(eleIds).stream().collect(Collectors.toMap(WbsFormElement::getId, Function.identity()));
|
|
|
|
+ for (TrialSummaryExcelTabReflection obj : query) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("id", obj.getId());
|
|
|
|
+ map.put("trialTabId", obj.getTrialTabId());
|
|
|
|
+ map.put("elementId", obj.getElementId());
|
|
|
|
+ map.put("elementValue", eleMap.getOrDefault(obj.getElementId(), null));
|
|
|
|
+ map.put("htmlKeyName", obj.getHtmlKeyName());
|
|
|
|
+ maps.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return R.data(maps);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|