Prechádzať zdrojové kódy

bug

Signed-off-by: liuyc <56808083@qq.com>
liuyc 8 mesiacov pred
rodič
commit
32ab2370db

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TrialSummaryExcelTabReflection.java

@@ -10,6 +10,9 @@ public class TrialSummaryExcelTabReflection implements Serializable {
 
     private Long id;
 
+    @ApiModelProperty(value = "分类id")
+    private Long classId;
+
     @ApiModelProperty(value = "关联的清表id")
     private Long excelId;
 

+ 2 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/MeterContractInfo.java

@@ -1,6 +1,7 @@
 package org.springblade.meter.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springblade.core.mp.base.BaseEntity;
@@ -81,6 +82,7 @@ public class MeterContractInfo extends BaseEntity {
     private String farmersBankAccountNumber;
 
     @ApiModelProperty(value = "农民工工资专户 银行账户名称")
+    @JsonProperty(value = "farmersBankAccountName")
     private String farmersBankAccountName;
 
     @ApiModelProperty(value = "中期计量最高支付比例")

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialSummaryController.java

@@ -194,9 +194,9 @@ public class TrialSummaryController {
             }
             List<Long> recordIds = records.stream().map(TrialSelfInspectionRecord::getId).collect(Collectors.toList());
 
-            String sql_2 = "SELECT * FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ?";
+            String sql_2 = "SELECT * FROM m_trial_summary_excel_tab_reflection WHERE excel_id = ? AND class_id = ?";
             List<TrialSummaryExcelTabReflection> excelTabReflections = jdbcTemplate.query(sql_2,
-                    new Object[]{classC.getExcelId()}, new BeanPropertyRowMapper<>(TrialSummaryExcelTabReflection.class));
+                    new Object[]{classC.getExcelId(), classC.getId()}, new BeanPropertyRowMapper<>(TrialSummaryExcelTabReflection.class));
             Map<String, List<TrialSummaryExcelTabReflection>> maps = excelTabReflections.stream()
                     .collect(Collectors.groupingBy(
                             reflection -> reflection.getTrialTabName() + "###" + reflection.getTrialTabId()

+ 32 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TrialSummaryClassificationConfigurationController.java

@@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.validation.Valid;
 import java.io.*;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 
@@ -234,17 +235,19 @@ public class TrialSummaryClassificationConfigurationController extends BladeCont
                         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, ",") + ")";
                     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,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<>();
                     for (TrialSummaryReflectionSaveDTO.ReflectionBean reflectionBean : collect) {
                         Object[] paramsInsert = {
                                 SnowFlakeUtil.getId(),
+                                classificationConfiguration.getId(),
                                 classificationConfiguration.getExcelId(),
                                 reflectionBean.getTrialTabId(),
                                 reflectionBean.getElementId(),
@@ -275,4 +278,31 @@ public class TrialSummaryClassificationConfigurationController extends BladeCont
         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);
+    }
+
 }