| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | |
| | | @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; |
| | | } |
| | | |
| | |
| | | |
| | | List<FactoryDto> selectStandardTreeList(); |
| | | |
| | | List<StandardTree> selectStandardTreeList2(String sampleType); |
| | | |
| | | StandardProductList selectStandardProductById(Integer id); |
| | | |
| | | List<StandardProductList> getStandardProductListBySample(String sampleType); |
| | |
| | | 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()); |
| | |
| | | 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); |
| | |
| | | </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> |
| | |
| | | </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"> |
| | |
| | | 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> |
| | |
| | | # redis端口(默认为6379) |
| | | port: 6379 |
| | | # redis访问密码(默认为空) |
| | | password: 123456 |
| | | password: |
| | | # redis连接超时时间(单位毫秒) |
| | | timeout: 50 |
| | | # redis连接池配置 |