chenrui
2025-04-07 b999398ae9b2719d2db15716dd353f7a3855d59e
Merge branch 'radio_frequency' of http://114.132.189.42:9002/r/lims-ruoyi-after into radio_frequency
已修改6个文件
103 ■■■■ 文件已修改
basic-server/src/main/java/com/ruoyi/basic/excel/MultiSheetImportListener.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-test.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/UserMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/excel/MultiSheetImportListener.java
@@ -18,9 +18,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@@ -37,6 +35,9 @@
    private final StandardTemplateService standardTemplateService;
    // 新增:内存去重集合(记录唯一键)
    private Set<String> uniqueKeys = new HashSet<>();
    public MultiSheetImportListener(StructureItemParameterService parameterService, StandardTemplateService standardTemplateService,
                                    ISysDictTypeService dictTypeService) {
        this.parameterService = parameterService;
@@ -47,6 +48,18 @@
    @Override
    public void invoke(StructureItemParameter data, AnalysisContext context) {
        String uniqueKey = buildUniqueKey(data);
        if (uniqueKeys.contains(uniqueKey)) {
            log.warn("发现重复数据,已跳过: {} (Sheet: {}, 行号: {})",
                    uniqueKey,
                    currentSheetName,
                    context.readRowHolder().getRowIndex() + 1
            );
            return;
        }
        uniqueKeys.add(uniqueKey);
        data.setId(null);
        // 测试对象
        if (data.getSample() == null) {
@@ -217,4 +230,15 @@
        // 打印完整错误堆栈(调试时开启)
        log.error("Sheet[{}] 第{}行第{}列解析失败: {}", sheetName, rowIndex, columnIndex, errorMsg);
    }
    private String buildUniqueKey(StructureItemParameter data) {
        return String.join("|",
                ObjectUtils.defaultIfNull(data.getInspectionItem(), ""),
                ObjectUtils.defaultIfNull(data.getInspectionItemEn(),""),
                ObjectUtils.defaultIfNull(data.getProduct(),""),
                ObjectUtils.defaultIfNull(data.getInspectionItemSubclass(), ""),
                ObjectUtils.defaultIfNull(data.getSample(), ""),
                ObjectUtils.defaultIfNull(data.getInspectionItemClass(), "")
        );
    }
}
basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java
@@ -296,8 +296,8 @@
        // 对检测对象先按照实验室在按照检查对象类别分类
        List<BasicTreeDto> testProjectBasicTreeList = structureTestObjectList.stream().map(structureTestObject -> {
            BasicTreeDto basicTreeDto = new BasicTreeDto();
            basicTreeDto.setValue(structureTestObject.getSpecimenName());
            basicTreeDto.setLabel(structureTestObject.getSpecimenName());
            basicTreeDto.setValue(structureTestObject.getSpecimenName() + "(" + structureTestObject.getObjectType() + ")");
            basicTreeDto.setLabel(structureTestObject.getSpecimenName() + "(" + structureTestObject.getObjectType() + ")");
            basicTreeDto.setLevel(BasicTreeEnums.STRUCTURE_TEST_OBJECT_TYPE.getCode());
            List<BasicTreeDto> children = new ArrayList<>();
            if (!CollectionUtils.isEmpty(productMap.get(structureTestObject.getId()))) {
@@ -339,6 +339,7 @@
    /**
     * 河口检测中心导入
     *
     * @param file
     */
    @Override
@@ -618,6 +619,7 @@
    /**
     * 修改标准数
     *
     * @param modelAddDto
     * @return
     */
basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml
@@ -145,28 +145,46 @@
        <result property="name" column="subclass"/>
    </resultMap>
    <select id="getInsProduction" resultMap="getInsProductions">
        select distinct id,
        SELECT DISTINCT
            id,
                        CASE
                            WHEN INSTR(sample, ',') > 0 THEN
                                SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1)
                            when sample = '[""]' then '*'
                    TRIM(BOTH '"' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', - 1), '"]]', 1))
                WHEN sample = '[""]' THEN
                    '*'
                            ELSE
                                TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1))
                            END
                                                              as sample,
                END AS sample,
                        inspection_item,
                        case
                            when inspection_item_subclass is null or inspection_item_subclass = '' then inspection_item
                            else inspection_item_subclass end as subclass,
                        case
                            when inspection_item_class is null or inspection_item_class = '' then inspection_item
                            else inspection_item_class end as item_class
        from structure_item_parameter
            CASE
                WHEN inspection_item_subclass IS NULL
                    OR TRIM(inspection_item_subclass) = '' THEN
                    inspection_item
                ELSE
                    inspection_item_subclass
                END AS subclass,
            CASE
                WHEN inspection_item_class IS NULL
                    OR TRIM(inspection_item_class) = '' THEN
                    inspection_item
                ELSE
                    inspection_item_class
                END AS item_class
        FROM
            structure_item_parameter;
    </select>
    <select id="getItemTree" resultMap="itemDto">
        select sto.id sId, sto.specimen_name sName, p.id pId, p.name pName
        from structure_test_object sto
                 left join product p on p.object_id = sto.id
        SELECT
            sto.id AS sId,
            CONCAT(sto.specimen_name, ' (', sto.object_type, ')') AS sName,
            p.id AS pId,
            p.name AS pName,
            sto.object_type
        FROM
            structure_test_object sto
                LEFT JOIN
            product p
            ON p.object_id = sto.id;
    </select>
    <resultMap id="itemDto" type="com.ruoyi.basic.dto.TestItemDto">
ruoyi-admin/src/main/resources/application-test.yml
@@ -143,16 +143,16 @@
# 人事系统
personnel:
  # 正式地址
  code:
  code: https://ztt-sso.ztt.cn/oauth2/token
  # 装备人事正式库
  appId:
  appSecret:
  companies:
  simple:
  appId: f6f3d70f-3666-4d3d-b9c5-430de3f6007c
  appSecret: a18923496542302066b0a7bec993a4e2
  companies: https://ztt-connector.ztt.cn/api/org/v1/companies
  simple: https://ztt-connector.ztt.cn/api/org/v1/employees/simple?companyId=
  # 人员密码获取
  password:
  department:
  person:
  password: https://ztt-connector.ztt.cn/api/org/v1/employees/original_pwd/
  department: https://ztt-connector.ztt.cn/api/org/v1/companies/companyId/departments
  person: https://ztt-connector.ztt.cn/api/org/v1/employees/simple/
ifs:
  contract:
ruoyi-system/src/main/resources/mapper/system/UserMapper.xml
@@ -24,8 +24,7 @@
        company,
        is_custom
        from user
        where del_flag = '0'
        and id != ) a
        where del_flag = '0') a
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>