Merge branch 'radio_frequency' of http://114.132.189.42:9002/r/lims-ruoyi-after into radio_frequency
| | |
| | | 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 |
| | |
| | | |
| | | private final StandardTemplateService standardTemplateService; |
| | | |
| | | // 新增:内存去重集合(记录唯一键) |
| | | private Set<String> uniqueKeys = new HashSet<>(); |
| | | |
| | | public MultiSheetImportListener(StructureItemParameterService parameterService, StandardTemplateService standardTemplateService, |
| | | ISysDictTypeService dictTypeService) { |
| | | this.parameterService = parameterService; |
| | |
| | | |
| | | @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) { |
| | |
| | | // 打印完整错误堆栈(调试时开启) |
| | | 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(), "") |
| | | ); |
| | | } |
| | | } |
| | |
| | | // 对检测对象先按照实验室在按照检查对象类别分类 |
| | | 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()))) { |
| | |
| | | |
| | | /** |
| | | * 河口检测中心导入 |
| | | * |
| | | * @param file |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 修改标准数 |
| | | * |
| | | * @param modelAddDto |
| | | * @return |
| | | */ |
| | |
| | | <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"> |
| | |
| | | # 人事系统 |
| | | 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: |
| | |
| | | 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> |