basic-server/src/main/java/com/ruoyi/basic/controller/StandardMethodController.java
@@ -50,10 +50,4 @@ return Result.success(standardMethodService.upStandardMethod(standardMethod)); } @ApiOperation(value = "å¯¼å ¥æ åæç»") @PostMapping("/importStandardDetails") public Result<?> importStandardDetails(@RequestPart("file") MultipartFile file) throws IOException { standardMethodService.inputExcel(file); return Result.success(); } } basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java
@@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.ruoyi.basic.service.*; import com.ruoyi.common.core.domain.Result; import com.ruoyi.basic.dto.CopyStandardProductListDto; import com.ruoyi.basic.dto.FactoryDto; @@ -10,10 +11,6 @@ import com.ruoyi.basic.pojo.StandardProductList; import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; import com.ruoyi.basic.pojo.StandardTree; import com.ruoyi.basic.service.StandardMethodListService; import com.ruoyi.basic.service.StandardProductListService; import com.ruoyi.basic.service.StandardProductListSupplierAskService; import com.ruoyi.basic.service.StandardTreeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -33,7 +30,7 @@ private StandardTreeService standardTreeService; private StandardMethodListService standardMethodListService; private StandardMethodService standardMethodService; private StandardProductListService standardProductListService; @@ -60,7 +57,7 @@ @ApiOperation(value = "æ ¹æ®æ åæ è¿è¡æ åæ¥è¯¢") @GetMapping("/selectsStandardMethodByFLSSM") public Result selectsStandardMethodByFLSSM(String tree) { return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); return Result.success(standardMethodService.selectsStandardMethodByFLSSM(tree)); } @ApiOperation(value = "ä¿®æ¹æ ååºä¸çå 容") @@ -112,7 +109,7 @@ @ApiOperation(value = "è·åæ åæ ä¸æ åæ¹æ³æä¸¾") @GetMapping("/selectStandardMethodEnum") public Result selectStandardMethodEnum() { return Result.success(standardMethodListService.selectStandardMethodEnum()); return Result.success(standardMethodService.selectStandardMethodEnum()); } @ApiOperation(value = "è·åäº§åæ¶æ") @@ -131,49 +128,6 @@ return Result.success(standardTreeService.upStandardProducts(product)); } @ApiOperation("ä» è·åå 纤çåå·") @GetMapping("/getStandTreeBySampleType") public Result<?> getStandTreeBySampleType(String laboratory, String sampleType) { return Result.success(standardTreeService.getStandTreeBySampleType(laboratory, sampleType)); } @ApiOperation("å¯¼å ¥æ ååº") @PostMapping("/inExcelOfTree/{isEquipment}") public Result inExcelOfTree(@RequestParam("file") MultipartFile file, @PathVariable("isEquipment") Boolean isEquipment) { if (!isEquipment) { standardTreeService.inExcelOfTree(file); } else { standardTreeService.importWorkstationExcel(file); } return Result.success(); } @ApiOperation("éç½®æ ååºåä»·") @PostMapping("/resetTreeOfPrice") public Result resetTreeOfPrice(@RequestBody Map<String, Object> map) { String tree = (String) map.get("tree"); Integer standardId = (Integer) map.get("standardId"); standardTreeService.resetTreeOfPrice(tree, standardId); return Result.success(); } @ApiOperation("éç½®æ ååºå·¥æ¶ç³»æ°") @PostMapping("/resetTreeOfHour") public Result resetTreeOfHour(@RequestBody Map<String, Object> map) { String tree = (String) map.get("tree"); Integer standardId = (Integer) map.get("standardId"); standardTreeService.resetTreeOfHour(tree, standardId); return Result.success(); } @ApiOperation("éç½®æ ååºè¦æ±æè¿°åè¦æ±å¼") @PostMapping("/resetTreeOfAsk") public Result resetTreeOfAsk(@RequestBody Map<String, Object> map) { String tree = (String) map.get("tree"); Integer standardId = (Integer) map.get("standardId"); standardTreeService.resetTreeOfAsk(tree, standardId); return Result.success(); } @ApiOperation("æ ååºææ½") @PostMapping("/resetTreeDrag") basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodListMapper.java
ÎļþÒÑɾ³ý basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodMapper.java
@@ -3,9 +3,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.pojo.StandardMethodList; import com.ruoyi.framework.mybatis_config.MyBaseMapper; import com.ruoyi.basic.pojo.StandardMethod; import org.apache.ibatis.annotations.Param; import java.util.List; /** * @author Administrator @@ -19,6 +22,17 @@ StandardMethod selectStandMethodById(@Param("id") Integer id); List<StandardMethodList> selectStandardMethodLists(@Param("tree") String tree); List<StandardMethodList> selectStandardMethodListsByNull(@Param("tree") String tree); List<StandardMethodList> selectStandardMethodLists3(@Param("tree") String tree); List<StandardMethodList> selectListEnum(); Integer getStandardMethodId(@Param("code") String code); } basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethodList.java
@@ -12,7 +12,6 @@ * æ åæ ä¸çæ åå表 * @TableName standard_method_list */ @TableName(value ="standard_method_list") @Data public class StandardMethodList implements Serializable { /** basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java
ÎļþÒÑɾ³ý basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodService.java
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.basic.pojo.StandardMethod; import com.ruoyi.basic.pojo.StandardMethodList; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.List; import java.util.Map; /** * @author Administrator @@ -26,5 +28,8 @@ int upStandardMethod(StandardMethod standardMethod); void inputExcel(MultipartFile file) throws IOException; Map<String, List<?>> selectsStandardMethodByFLSSM(String tree); List<StandardMethodList> selectStandardMethodEnum(); } basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java
@@ -27,18 +27,6 @@ int upStandardProducts(Map<String, Object> product); List<StandardTree> getStandTreeBySampleType(String laboratory, String sampleType); void inExcelOfTree(MultipartFile file); void resetTreeOfPrice(String tree, Integer standardId); void resetTreeOfHour(String tree, Integer standardId); void resetTreeOfAsk(String tree, Integer standardId); void importWorkstationExcel(MultipartFile file); /** * æ åæ°æåº * @param list basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java
ÎļþÒÑɾ³ý basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodServiceImpl.java
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.pojo.StandardMethodList; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.basic.mapper.StandardMethodMapper; import com.ruoyi.basic.mapper.StandardProductListMapper; @@ -39,11 +40,11 @@ private StandardMethodMapper standardMethodMapper; StandardProductListMapper standardProductListMapper; StandardProductListService standardProductListService; private StandardProductListMapper standardProductListMapper; private StandardProductListService standardProductListService; StructureItemParameterMapper structureItemParameterMapper; StructureItemParameterService structureItemParameterService; private StructureItemParameterMapper structureItemParameterMapper; private StructureItemParameterService structureItemParameterService; @Override public IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod) { @@ -128,26 +129,6 @@ return "æ¿æ¢å®æ¯!"; } @Transactional(rollbackFor = Exception.class) @Override public void inputExcel(MultipartFile file) throws IOException { // å卿£æµå¯¹è±¡List List<Object> structureTestObjectIdList = new ArrayList<>(); List<StandardMethod> result = new ArrayList<>(); ExcelUtil.readBySax(file.getInputStream(), 0, (i, l, list) -> { // å»é¤ç¬¬ä¸è¡è¡¨å¤´ if (l == 0) { return; } // åå¨å¯ä¸æ£æµå¯¹è±¡ if (!structureTestObjectIdList.contains(list.get(2))) { structureTestObjectIdList.add(list.get(2)); } StandardMethod standardMethod = formatData(list); result.add(standardMethod); }); addStructureTest(structureTestObjectIdList, result); } // æ ¼å¼åæ°æ® public StandardMethod formatData(List<Object> list) { @@ -185,74 +166,42 @@ return standardMethod; } // æ°å¢æ°æ® public void addStructureTest(List<Object> structureTestObjectIdList, List<StandardMethod> standardMethodList) { List<StandardMethod> updateList = new ArrayList<>(); List<Integer> deleteListId = new ArrayList<>(); List<StandardMethod> addList = new ArrayList<>(); if (!structureTestObjectIdList.isEmpty()) { // 循ç¯exceléé¢çåç» structureTestObjectIdList.forEach(j -> { // 以excelä¸çç»åæ¥è¯¢æ°æ®åºä¸çåç» List<StandardMethod> standardMethods = baseMapper.selectList(Wrappers.<StandardMethod>lambdaQuery() .like(StandardMethod::getStructureTestObjectId, "\"" + j + "\"")); // å°ç»æå¾ªç¯å¹é for (int i = 0; i < standardMethods.size(); i++) { boolean isExistence = false; for (int i1 = 0; i1 < standardMethodList.size(); i1++) { // æ´æ° if (standardMethods.get(i).getStructureTestObjectId().equals(standardMethodList.get(i1).getStructureTestObjectId()) && standardMethods.get(i).getCode().equals(standardMethodList.get(i1).getCode()) && standardMethods.get(i).getField().equals(standardMethodList.get(i1).getField())) { // ç»excelæ°æ®èµå¼idåæ´æ° standardMethodList.get(i1).setId(standardMethods.get(i).getId()); // æ´æ° updateList.add(standardMethodList.get(i1)); isExistence = true; break; } } // å é¤ if (!isExistence) { deleteListId.add(standardMethods.get(i).getId()); } } for (int i = 0; i < standardMethodList.size(); i++) { if (standardMethodList.get(i).getStructureTestObjectId().contains("\"" + j + "\"")) { boolean isExistence = false; for (int i1 = 0; i1 < standardMethods.size(); i1++) { if (standardMethods.get(i1).getStructureTestObjectId().equals(standardMethodList.get(i).getStructureTestObjectId()) && standardMethods.get(i1).getCode().equals(standardMethodList.get(i).getCode()) && standardMethods.get(i1).getField().equals(standardMethodList.get(i).getField())) { isExistence = true; break; } } // æ°å¢ if (!isExistence) { addList.add(standardMethodList.get(i)); } } } }); @Override public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) { String[] trees = tree.split(" - "); Map<String, List<?>> map = new HashMap<>(); String str = ""; List<StandardMethodList> standardMethodLists = new ArrayList<>(); switch (trees.length){ case 5: str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\""; standardMethodLists.addAll(standardMethodMapper.selectStandardMethodLists(str)); standardMethodLists.addAll(standardMethodMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\"")); standardMethodLists.addAll(standardMethodMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); break; case 4: str += "\"" + trees[2] + "\",\"" + trees[3] + "\""; standardMethodLists.addAll(standardMethodMapper.selectStandardMethodLists(str)); standardMethodLists.addAll(standardMethodMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); break; case 3: str += "\"" + trees[2] + "\""; standardMethodLists.addAll(standardMethodMapper.selectStandardMethodLists3(str)); break; default: map.put("standardMethodList", null); return map; } if (!addList.isEmpty()) { // æ°å¢ baseMapper.insertBatchSomeColumn(addList); } if (!deleteListId.isEmpty()) { // å é¤ baseMapper.deleteBatchIds(deleteListId); } if (!updateList.isEmpty()) { // æ´æ° updateList.forEach(i -> { baseMapper.updateById(i); }); } standardMethodLists.addAll(standardMethodMapper.selectStandardMethodListsByNull(str)); map.put("standardMethodList", standardMethodLists); return map; } @Override public List<StandardMethodList> selectStandardMethodEnum() { return standardMethodMapper.selectListEnum(); } } basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java
@@ -1,38 +1,32 @@ package com.ruoyi.basic.service.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.poi.excel.ExcelUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.dto.SampleDto; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.basic.dto.FactoryDto; import com.ruoyi.basic.dto.LaboratoryDto; import com.ruoyi.basic.dto.SampleTypeDto; import com.ruoyi.basic.mapper.StandardProductListMapper; import com.ruoyi.basic.mapper.StandardTreeMapper; import com.ruoyi.basic.pojo.StandardProductList; import com.ruoyi.basic.pojo.StandardTemplate; import com.ruoyi.basic.pojo.StandardTree; import com.ruoyi.basic.pojo.StructureTestObject; import com.ruoyi.basic.service.*; import com.ruoyi.basic.service.StandardProductListService; import com.ruoyi.basic.service.StandardTreeService; import com.ruoyi.basic.service.StructureTestObjectService; import com.ruoyi.common.exception.base.BaseException; import lombok.AllArgsConstructor; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * @author Administrator @@ -47,13 +41,9 @@ private StandardTreeMapper standardTreeMapper; private StandardMethodListService standardMethodListService; private StandardProductListMapper standardProductListMapper; private StandardProductListService standardProductListService; private StandardTemplateService standardTemplateService; private StructureTestObjectService structureTestObjectService; @@ -135,271 +125,6 @@ } @Override public List<StandardTree> getStandTreeBySampleType(String laboratory, String sampleType) { return standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery() .eq(StandardTree::getLaboratory, laboratory) .eq(StandardTree::getSampleType, sampleType) .select(StandardTree::getModel, StandardTree::getSample)); } /** * æ²³å£æ£æµä¸å¿å¯¼å ¥ * @param file */ @Override @Transactional(rollbackFor = Exception.class) public void inExcelOfTree(MultipartFile file) { InputStream inputStream; try { inputStream = file.getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } List<StandardProductList> lists = new ArrayList<>(); AtomicReference<String> laboratory = new AtomicReference<>(); ExcelUtil.readBySax(inputStream, 0, (i, l, list) -> { StandardProductList str = new StandardProductList(); if (i == 0 && l == 1) { laboratory.set(standardTreeMapper.getLaboratory(list.get(1) + "")); if (laboratory.get() == null) { throw new BaseException("æ£éªå¯¹è±¡ä¸åå¨ï¼" + list.get(1)); } } if (i == 0 && l >= 1) { Integer standardMethodId = standardMethodListService.getStandardMethodId(list.get(0) + ""); if (standardMethodId == null) { throw new BaseException("æ åç¼å·ä¸åå¨ï¼" + list.get(0)); } str.setStandardMethodListId(standardMethodId); str.setSampleType(list.get(1) + ""); if (list.get(2) != null) { String sample = baseMapper.selSample(list.get(2) + ""); if (sample == null) { throw new BaseException("æ ·åä¸åå¨ï¼" + list.get(2)); } str.setSample(list.get(2) + ""); } else { str.setSample(null); } if (list.get(3) != null) { str.setModel(list.get(3) + ""); Long aLong = standardTreeMapper.selectCount(Wrappers.<StandardTree>lambdaQuery() .eq(StandardTree::getModel, str.getModel()) .eq(StandardTree::getSampleType, list.get(1) + "")); if (aLong == 0) { StandardTree standardTree = new StandardTree(); standardTree.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); standardTree.setLaboratory(laboratory.get()); standardTree.setSampleType(str.getSampleType()); standardTree.setSample(str.getSample()); standardTree.setModel(str.getModel()); standardTreeMapper.insert(standardTree); } } else { str.setModel(null); } str.setInspectionItem(list.get(4) + ""); if (list.get(6) == null) { str.setInspectionItemSubclass(""); } else { str.setInspectionItemSubclass(list.get(6).toString()); } StandardProductList db_str; try { db_str = standardProductListMapper.getOne(str.getStandardMethodListId(), str.getInspectionItem(), str.getSample(), str.getInspectionItemSubclass(), str.getModel(), str.getInspectionItemClass()); } catch (Exception e) { throw new BaseException("é夿¥è¯¢ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); } if (ObjectUtils.isNotEmpty(db_str)) { str.setId(db_str.getId()); str.setStructureItemParameterId(db_str.getStructureItemParameterId()); } if (list.get(8) != null) { str.setMethodS(list.get(8) + ""); } if (list.get(11) == null) { str.setTell(null); } else { str.setTell(list.get(11).toString()); } if (list.get(12) == null) { str.setAsk(null); } else { str.setAsk(list.get(12).toString()); } if (list.get(13) == null) { str.setPrice(null); } else { str.setPrice((list.get(13).toString())); } if (list.get(14) == null) { str.setManHour(null); } else { str.setManHour(list.get(14).toString()); } StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list.get(21))); if (standTempIdByName != null) { str.setTemplateId(standTempIdByName.getId()); } else { throw new BaseException("模æ¿ä¸åå¨ï¼" + list.get(21)); } str.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); str.setLaboratory(laboratory.get()); str.setState(1); str.setTree(str.getFactory() + " - " + str.getLaboratory() + " - " + str.getSampleType() + " - " + str.getSample() + " - " + (str.getModel() == null ? "" : str.getModel())); try { str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); } catch (Exception e) { str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\",\"" + str.getSample() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); } if (str.getStructureItemParameterId() == null) { throw new BaseException("æ£éªé¡¹ç®ä¸åå¨ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); } lists.add(str); } }); lists.forEach(a -> { if (a.getId() != null) { standardProductListMapper.updateById(a); } else { standardProductListMapper.insert(a); } }); } @Override public void importWorkstationExcel(MultipartFile file) { InputStream inputStream; try { inputStream = file.getInputStream(); } catch (IOException e) { throw new RuntimeException(e); } List<StandardProductList> lists = new ArrayList<>(); AtomicReference<String> laboratory = new AtomicReference<>(); ExcelUtil.readBySax(inputStream, 0, (i, l, list) -> { StandardProductList str = new StandardProductList(); if (i == 0 && l == 1) { laboratory.set(standardTreeMapper.getLaboratory(list.get(1) + "")); if (laboratory.get() == null) { throw new BaseException("æ£éªå¯¹è±¡ä¸åå¨ï¼" + list.get(1)); } } if (i == 0 && l >= 1) { Integer standardMethodId = standardMethodListService.getStandardMethodId(list.get(0) + ""); if (standardMethodId == null) { throw new BaseException("æ åç¼å·ä¸åå¨ï¼" + list.get(0)); } str.setStandardMethodListId(standardMethodId); str.setSampleType(list.get(1) + ""); if (list.get(2) != null) { String sample = baseMapper.selSample(list.get(2) + ""); if (sample == null) { throw new BaseException("æ ·åä¸åå¨ï¼" + list.get(2)); } str.setSample(list.get(2) + ""); } else { str.setSample(null); } if (list.get(3) != null) { str.setModel(list.get(3) + ""); Long aLong = standardTreeMapper.selectCount(Wrappers.<StandardTree>lambdaQuery() .eq(StandardTree::getModel, str.getModel()) .eq(StandardTree::getSampleType, list.get(1) + "")); if (aLong == 0) { StandardTree standardTree = new StandardTree(); standardTree.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); standardTree.setLaboratory(laboratory.get()); standardTree.setSampleType(str.getSampleType()); standardTree.setSample(str.getSample()); standardTree.setModel(str.getModel()); standardTreeMapper.insert(standardTree); } } else { str.setModel(null); } str.setInspectionItemClass(list.get(4).toString()); str.setInspectionItemClassEn(list.get(5).toString()); // å¼å§å 2 str.setInspectionItem(list.get(6) + ""); if (list.get(8) == null) { str.setInspectionItemSubclass(""); } else { str.setInspectionItemSubclass(list.get(8).toString()); } StandardProductList db_str; try { db_str = standardProductListMapper.getOne(str.getStandardMethodListId(), str.getInspectionItem(), str.getSample(), str.getInspectionItemSubclass(), str.getModel(), str.getInspectionItemClass()); } catch (Exception e) { throw new BaseException("é夿¥è¯¢ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); } if (ObjectUtils.isNotEmpty(db_str)) { str.setId(db_str.getId()); str.setStructureItemParameterId(db_str.getStructureItemParameterId()); } if (list.get(10) != null) { str.setMethodS(list.get(10) + ""); } if (list.get(13) == null) { str.setTell(null); } else { str.setTell(list.get(13).toString()); } if (list.get(14) == null) { str.setAsk(null); } else { str.setAsk(list.get(14).toString()); } if (list.get(15) == null) { str.setPrice(null); } else { str.setPrice((list.get(15).toString())); } if (list.get(16) == null) { str.setManHour(null); } else { str.setManHour(list.get(16).toString()); } StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list.get(23))); if (standTempIdByName != null) { str.setTemplateId(standTempIdByName.getId()); } else { throw new BaseException("模æ¿ä¸åå¨ï¼" + list.get(23)); } str.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); str.setLaboratory(laboratory.get()); str.setState(1); str.setTree(str.getFactory() + " - " + str.getLaboratory() + " - " + str.getSampleType() + " - " + str.getSample() + " - " + (str.getModel() == null ? "" : str.getModel())); try { str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); } catch (Exception e) { str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\",\"" + str.getSample() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); } if (str.getStructureItemParameterId() == null) { throw new BaseException("æ£éªé¡¹ç®ä¸åå¨ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); } lists.add(str); } }); lists.forEach(a -> { if (a.getId() != null) { standardProductListMapper.updateById(a); } else { standardProductListMapper.insert(a); } }); } @Override public boolean updateTreeSort(List<FactoryDto> list) { List<StructureTestObject> testObjects = new ArrayList<>(); for (FactoryDto factoryDto : list) { @@ -463,28 +188,6 @@ return standardTreeMapper.update(null, wrapper); } @Override public void resetTreeOfPrice(String tree, Integer standardId) { standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId).set(StandardProductList::getPrice, null)); } @Override public void resetTreeOfHour(String tree, Integer standardId) { standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId).set(StandardProductList::getManHour, null)); } @Override public void resetTreeOfAsk(String tree, Integer standardId) { standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId) .set(StandardProductList::getAsk, null) .set(StandardProductList::getTell, null) .set(StandardProductList::getSection, null) .set(StandardProductList::getCores, null) .set(StandardProductList::getConductorMaterial, null) .set(StandardProductList::getConductorType, null) .set(StandardProductList::getPrice, null) .set(StandardProductList::getManHour, null)); } } basic-server/src/main/resources/mapper/StandardMethodListMapper.xml
ÎļþÒÑɾ³ý basic-server/src/main/resources/mapper/StandardMethodMapper.xml
@@ -64,4 +64,39 @@ left join structure_test_object sto on sm.structure_test_object_id = sto.id where sm.id = #{id} </select> <select id="selectStandardMethodLists" resultType="com.ruoyi.basic.pojo.StandardMethodList"> select id, code, name, remark from standard_method where is_use = 1 and is_product = 1 and structure_test_object_id LIKE CONCAT('%[', #{tree}, ']%') </select> <select id="selectStandardMethodLists3" resultType="com.ruoyi.basic.pojo.StandardMethodList"> select id, code, name, remark from standard_method where is_use = 1 and is_product = 1 and structure_test_object_id LIKE CONCAT('%', #{tree}, '%') </select> <select id="selectListEnum" resultType="com.ruoyi.basic.pojo.StandardMethodList"> select id,code,name from standard_method where is_product = 1 and is_use = 1 </select> <select id="selectStandardMethodListsByNull" resultType="com.ruoyi.basic.pojo.StandardMethodList"> select id, code, name, remark from standard_method where is_use = 1 and is_product = 1 and ( structure_test_object_id is null OR structure_test_object_id = '' OR structure_test_object_id = '[]' ) </select> <select id="getStandardMethodId" resultType="java.lang.Integer"> select id from standard_method where code = #{code} </select> </mapper> basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml
@@ -40,7 +40,8 @@ inspection_item_class_en, code, radius_list, rates rates, device_ids from (select *, CASE WHEN INSTR(sample, ',') > 0 THEN