value
2024-04-26 0830f6724578925ac2279fbfae2966b0bb88b027
标准库刷新检验项目
已修改7个文件
72 ■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/service/impl/CapacityScopeServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardTreeMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsOrderMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/impl/CapacityScopeServiceImpl.java
@@ -1,6 +1,5 @@
package com.yuanchu.mom.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -57,13 +56,13 @@
            itemParameter.setBsm("0");
        }
        int insert = structureItemParameterMapper.insert(itemParameter);
        standardTreeService.reTreeBySampleType(structureTestObjectMapper.selectById(itemParameter.getSample()).getSpecimenName());
        standardTreeService.reTreeBySampleType(itemParameter.getSample());
        return insert;
    }
    @Override
    public int delItemParameter(Integer id) {
        standardTreeService.reTreeBySampleType(structureTestObjectMapper.selectById(structureItemParameterMapper.selectById(id).getSample()).getSpecimenName());
        standardTreeService.reTreeBySampleType(structureItemParameterMapper.selectById(id).getSample());
        int i = structureItemParameterMapper.deleteById(id);
        return i;
    }
@@ -71,10 +70,7 @@
    @Override
    public int upItemParameter(StructureItemParameter itemParameter) {
        int i = structureItemParameterMapper.updateById(itemParameter);
        if(itemParameter.getSample() != null){
            List<String> list = JSON.parseArray(itemParameter.getSample(), String.class);
            standardTreeService.reTreeBySampleType(list.get(0));
        }
        standardTreeService.reTreeBySampleType(itemParameter.getSample());
        return i;
    }
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardTreeMapper.java
@@ -18,6 +18,8 @@
    List<FactoryDto> selectStandardTreeList();
    List<StandardTree> selectStandardTreeList2(String sampleType);
    StandardProductList selectStandardProductById(Integer id);
    List<StandardProductList> getStandardProductListBySample(String sampleType);
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -526,8 +526,7 @@
            tables.forEach(table -> {
                table.put("tableSize", tables.size() + 1);
            });
//            List<Map<String, String>> deviceList = insOrderMapper.selectDeviceList(deviceSet);
            List<Map<String, String>> deviceList = new ArrayList<>();
            List<Map<String, String>> deviceList = insOrderMapper.selectDeviceList(deviceSet);
            Map<String, String> codeStr = new HashMap<>();
            codeStr.put("报告编号", insReport.getCode());
            codeStr.put("样品名称", insOrder.getSample());
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
@@ -152,12 +152,24 @@
    public void reTreeBySampleType(String sampleType) {
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
        CompletableFuture.supplyAsync(() -> {
            //根据样品名称查询所有检测项目参数(能力)
            System.out.println(sampleType);
            List<String> sampleTree = new ArrayList<>();
            if(sampleType != null){
                sampleTree = JSON.parseArray(sampleType, String.class);
            }
            List<StandardProductList> productList = standardTreeMapper.getStandardProductListBySample(sampleType);
            List<StandardProductList> productList1 = JSON.parseArray(JSON.toJSONString(productList), StandardProductList.class);
            List<StandardMethodList> methodList = standardTreeMapper.getStandardMethodListBySample(sampleType);
            List<StandardMethodList> methodList = standardTreeMapper.getStandardMethodListBySample(sampleTree.get(0));
            List<StandardMethodList> methodList1 = JSON.parseArray(JSON.toJSONString(methodList), StandardMethodList.class);
            List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getSampleType, sampleType));
            List<StandardTree> treeList;
            if(sampleTree.size()==1){
                treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getSampleType, sampleTree.get(0)));
                treeList.addAll(standardTreeMapper.selectStandardTreeList2(sampleTree.get(0)));
            }else if(sampleTree.size()==2){
                treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getSampleType, sampleTree.get(0)).eq(StandardTree::getSample, sampleTree.get(1)));
            }else{
                treeList = standardTreeMapper.selectList(null);
            }
            for (StandardTree tree : treeList) {
                String treeStr = tree.getFactory() + " - " + tree.getLaboratory() + " - " + tree.getSampleType() + (tree.getSample() == null ? "" : " - " + tree.getSample()) + (tree.getModel() == null ? "" : " - " + tree.getModel());
                List<StandardMethodList> standardMethodList = JSON.parseArray(JSON.toJSONString(standardMethodListService.selectsStandardMethodByFLSSM(treeStr).get("standardMethodList")), StandardMethodList.class);
inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -159,9 +159,9 @@
        </if>
    </select>
    <select id="selectDeviceList" resultType="java.util.Map">
        select device_name,specification_model,factory_no,date_format(latest_traceability, '%Y-%m-%d')
        select device_name,specification_model,factory_no,date_format(next_calibration_date, '%Y-%m-%d')
        latest_traceability from device
        where device_name in
        where factory_no in
        <foreach collection="names" index="index" open="(" separator="," close=")" item="val">
            #{val}
        </foreach>
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -47,7 +47,13 @@
    </resultMap>
    <select id="selectStandardTreeList" resultMap="FactoryDto">
        select factory,laboratory,sample_type,sample,model from standard_tree
#         select factory,laboratory,sample_type,sample,model from standard_tree
        select '中天科技检测中心' factory, l.laboratory_name laboratory, sto.specimen_name sample_type, p.name sample, st.model from laboratory l
        left join structure_test_object sto on sto.laboratory_id = l.id
        left join product p on p.object_id = sto.id
        left join standard_tree st on st.laboratory = l.laboratory_name
        and st.sample_type = sto.specimen_name
        and st.sample = p.name
    </select>
    <select id="selectStandardProductById" resultType="com.yuanchu.mom.pojo.StandardProductList">
@@ -98,14 +104,31 @@
               ask,
               ask_tell as tell
        from structure_item_parameter sp
        left join structure_test_object sto on sto.id = sp.sample
        where sto.specimen_name = #{sampleType}
        where sp.sample = #{sampleType}
        or sp.sample = ''
        or sp.sample = '[]'
    </select>
    <select id="getStandardMethodListBySample" resultType="com.yuanchu.mom.pojo.StandardMethodList">
        select sm.code,sm.name,sm.remark from standard_method sm
        left join structure_test_object sto on sm.structure_test_object_id = sto.id
        where sto.specimen_name = #{sampleType}
        and is_use = 1
        where is_use = 1
        and is_product = 1
        <if test="sampleType != null">
            and sto.specimen_name = #{sampleType}
        </if>
    </select>
    <select id="selectStandardTreeList2" resultType="com.yuanchu.mom.pojo.StandardTree">
        select '中天科技检测中心'  factory,
               l.laboratory_name  laboratory,
               sto.specimen_name  sample_type,
               p.name             sample
        from laboratory l
                 left join structure_test_object sto on sto.laboratory_id = l.id
                 left join product p on p.object_id = sto.id
                 left join standard_tree st on st.laboratory = l.laboratory_name
            and st.sample_type = sto.specimen_name
            and st.sample = p.name
        where sto.specimen_name = #{sampleType}
        group by sto.specimen_name
    </select>
</mapper>
system-run/src/main/resources/application-dev.yml
@@ -67,7 +67,7 @@
    # redis端口(默认为6379)
    port: 6379
    # redis访问密码(默认为空)
    password: 123456
    password:
    # redis连接超时时间(单位毫秒)
    timeout: 50
    # redis连接池配置