From db1105ce858627ae139cd3e469914c32e8c0a949 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期五, 14 二月 2025 14:57:21 +0800 Subject: [PATCH] 搬迁基础模块(检验对象+检验项目+原始记录模块+标准库+标准方法+场所与设施+实验室资质) --- basic-server/src/main/java/com/ruoyi/basic/controller/StandardMethodController.java | 59 ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java | 3 basic-server/src/main/java/com/ruoyi/basic/service/CertificationService.java | 17 basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java | 63 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java | 150 basic-server/src/main/resources/mapper/StandardProductListMapper.xml | 144 basic-server/src/main/resources/mapper/StructureTestObjectPartMapper.xml | 8 basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java | 28 basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java | 56 basic-server/src/main/java/com/ruoyi/basic/dto/TestItemDto.java | 16 basic-server/src/main/java/com/ruoyi/basic/pojo/Laboratory.java | 62 basic-server/src/main/java/com/ruoyi/basic/mapper/CertificationMapper.java | 14 inspect-server/pom.xml | 19 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java | 35 basic-server/src/main/resources/mapper/StandardMethodMapper.xml | 67 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java | 701 ++++ basic-server/src/main/resources/mapper/StandardTreeMapper.xml | 384 ++ basic-server/src/main/java/com/ruoyi/basic/dto/SampleDto.java | 23 basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodListMapper.java | 40 basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodMapper.java | 26 basic-server/src/main/java/com/ruoyi/basic/pojo/ProductSupplierDensity.java | 57 basic-server/src/main/resources/mapper/ProductPartMapper.xml | 10 ruoyi-common/src/main/java/com/ruoyi/common/numgen/LambdaUtils.java | 127 basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java | 82 basic-server/src/main/java/com/ruoyi/basic/service/StructureItemParameterService.java | 8 basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java | 210 + basic-server/src/main/java/com/ruoyi/basic/controller/ProductSupplierDensityController.java | 59 basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethod.java | 85 basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java | 22 ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MySqlInjector.java | 24 basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java | 59 basic-server/src/main/java/com/ruoyi/basic/mapper/ProductMapper.java | 24 basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureItemParameterServiceImpl.java | 24 basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java | 22 basic-server/src/main/java/com/ruoyi/basic/mapper/ProductSupplierDensityMapper.java | 22 basic-server/src/main/java/com/ruoyi/basic/dto/LaboratoryDto.java | 18 basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java | 49 basic-server/src/main/java/com/ruoyi/basic/controller/CertificationController.java | 41 basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListSupplierAskService.java | 23 basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectService.java | 15 basic-server/src/main/java/com/ruoyi/basic/dto/InsSampleReceiveDto.java | 35 basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductSupplierDensityServiceImpl.java | 64 pom.xml | 16 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodServiceImpl.java | 260 + basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java | 92 basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java | 25 basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTemplate.java | 76 basic-server/src/main/resources/mapper/ProductSupplierDensityMapper.xml | 8 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTemplateServiceImpl.java | 130 ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGeneratorModelHelper.java | 107 basic-server/src/main/java/com/ruoyi/basic/dto/SampleTypeDto.java | 29 basic-server/src/main/java/com/ruoyi/basic/dto/ModelDto.java | 15 basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java | 52 ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberTableInfo.java | 16 basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java | 276 + ruoyi-common/src/main/java/com/ruoyi/common/numgen/SerializedLambda.java | 143 basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectServiceImpl.java | 19 basic-server/src/main/java/com/ruoyi/basic/dto/FactoryDto.java | 18 basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService.java | 67 basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService2.java | 13 basic-server/src/main/java/com/ruoyi/basic/service/impl/LaboratoryServiceImpl.java | 53 basic-server/src/main/resources/mapper/StandardProductListSupplierAskMapper.xml | 5 basic-server/src/main/java/com/ruoyi/basic/pojo/Certification.java | 72 basic-server/src/main/java/com/ruoyi/basic/dto/ProductDto.java | 11 basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java | 13 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java | 535 +++ basic-server/src/main/resources/mapper/StructureTestMapper.xml | 36 basic-server/src/main/java/com/ruoyi/basic/dto/CopyStandardProductListDto.java | 23 basic-server/src/main/java/com/ruoyi/basic/controller/LaboratoryController.java | 62 basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml | 121 basic-server/src/main/java/com/ruoyi/basic/controller/StandardTemplateController.java | 68 basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethodList.java | 83 basic-server/src/main/java/com/ruoyi/basic/service/LaboratoryService.java | 27 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java | 25 basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java | 393 ++ basic-server/src/main/java/com/ruoyi/basic/pojo/Product.java | 57 basic-server/src/main/resources/mapper/ProductMapper.xml | 44 basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java | 25 basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTree.java | 96 inspect-server/src/main/java/com/ruoyi/basic/pojo/InsSample.java | 123 basic-server/src/main/resources/mapper/LaboratoryMapper.xml | 42 basic-server/src/main/java/com/ruoyi/basic/mapper/LaboratoryMapper.java | 20 basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTemplateMapper.java | 32 basic-server/src/main/java/com/ruoyi/basic/pojo/InsSample1.java | 123 basic-server/src/main/resources/mapper/StandardTemplateMapper.xml | 40 basic-server/pom.xml | 33 basic-server/src/main/java/com/ruoyi/basic/service/ProductSupplierDensityService.java | 22 basic-server/src/main/java/com/ruoyi/basic/service/CapacityScopeService.java | 46 basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java | 188 + basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectListener.java | 38 basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodService.java | 30 ruoyi-common/src/main/java/com/ruoyi/common/handler/MybatisHandler.java | 23 basic-server/src/main/java/com/ruoyi/basic/pojo/StructureItemParameter.java | 121 basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java | 75 basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductList.java | 221 + ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGenerator.java | 146 basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java | 50 ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBaseMapper.java | 15 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java | 28 basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductListSupplierAsk.java | 58 basic-server/src/main/resources/mapper/IfsInventoryQuantityMapper.xml | 74 basic-server/src/main/java/com/ruoyi/basic/dto/ResetTreeDragDTO.java | 26 ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml | 234 basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java | 68 basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityCheckDto.java | 182 + basic-server/src/main/java/com/ruoyi/basic/service/StandardTemplateService.java | 34 basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java | 185 + ruoyi-admin/pom.xml | 33 basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectPartMapper.java | 21 basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java | 28 basic-server/src/main/resources/mapper/CertificationMapper.xml | 19 basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListMapper.java | 69 basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java | 14 ruoyi-common/pom.xml | 6 basic-server/src/main/java/com/ruoyi/basic/service/impl/CertificationServiceImpl.java | 45 basic-server/src/main/java/com/ruoyi/basic/mapper/IfsInventoryQuantityMapper.java | 42 basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListSupplierAskMapper.java | 18 basic-server/src/main/java/com/ruoyi/basic/mapper/StructureItemParameterMapper.java | 30 ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBatisPlusConfig.java | 27 basic-server/src/main/java/com/ruoyi/basic/dto/ProductDTO1.java | 16 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListService2Impl.java | 12 basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListSupplierAskServiceImpl.java | 79 basic-server/src/main/resources/mapper/StandardMethodListMapper.xml | 99 basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java | 124 124 files changed, 8,926 insertions(+), 139 deletions(-) diff --git a/basic-server/pom.xml b/basic-server/pom.xml new file mode 100644 index 0000000..e0f5431 --- /dev/null +++ b/basic-server/pom.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>ruoyi</artifactId> + <groupId>com.ruoyi</groupId> + <version>3.8.9</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>basic-server</artifactId> + <dependencies> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>ruoyi-common</artifactId> + </dependency> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>ruoyi-framework</artifactId> + </dependency> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>ruoyi-system</artifactId> + </dependency> + </dependencies> + + <properties> + <maven.compiler.source>8</maven.compiler.source> + <maven.compiler.target>8</maven.compiler.target> + </properties> + +</project> diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java new file mode 100644 index 0000000..810c430 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java @@ -0,0 +1,393 @@ +package com.ruoyi.basic.controller; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.poi.excel.ExcelUtil; +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.system.service.ISysDictTypeService; +import com.ruoyi.basic.dto.PageTestObjectDto; +import com.ruoyi.basic.dto.ProductDTO1; +import com.ruoyi.basic.excel.StructureTestObjectData; +import com.ruoyi.basic.excel.StructureTestObjectListener; +import com.ruoyi.basic.pojo.Product; +import com.ruoyi.basic.pojo.StandardTemplate; +import com.ruoyi.basic.pojo.StructureItemParameter; +import com.ruoyi.basic.pojo.StructureTestObject; +import com.ruoyi.basic.service.CapacityScopeService; +import com.ruoyi.basic.service.ProductService; +import com.ruoyi.basic.service.StandardTemplateService; +import com.ruoyi.basic.service.StructureItemParameterService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * 妫�楠岄」鐩弬鏁�(StructureItemParameter)琛ㄦ帶鍒跺眰 + * + * @author makejava + * @since 2024-02-26 16:21:17 + */ +@Api(tags = "鑳藉姏鑼冨洿") +@AllArgsConstructor +@RestController +@RequestMapping("/capacityScope") +public class CapacityScopeController { + + private CapacityScopeService capacityScopeService; + + private ProductService productService; + + private StructureItemParameterService structureItemParameterService; + + private ISysDictTypeService dictTypeService; + + private StandardTemplateService standardTemplateService; + + @ApiOperation(value = "鑾峰彇椤圭洰妫�楠屽弬鏁板垪琛�") + @PostMapping("/selectItemParameterList") + public Result selectItemParameterList(Page page,StructureItemParameter itemParameter) throws Exception { + return Result.success(capacityScopeService.selectItemParameterList(page, itemParameter)); + } + + @ApiOperation(value = "娣诲姞椤圭洰妫�楠屽弬鏁�") + @PostMapping("/addItemParameter") + public Result addItemParameter(@RequestBody StructureItemParameter itemParameter) { + return Result.success(capacityScopeService.addItemParameter(itemParameter)); + } + + @ApiOperation(value = "鍒犻櫎椤圭洰妫�楠屽弬鏁�") + @PostMapping("/delItemParameter") + public Result<?> delItemParameter(Integer id) { + return Result.success(capacityScopeService.delItemParameter(id)); + } + + @ApiOperation(value = "淇敼椤圭洰妫�楠屽弬鏁�") + @PostMapping("/upItemParameter") + public Result<?> upItemParameter(@RequestBody StructureItemParameter itemParameter) { + return Result.success(capacityScopeService.upItemParameter(itemParameter)); + } + + @ApiOperation(value = "鑾峰彇妫�楠屽璞�") + @PostMapping("/selectTestObjectList") + public Result selectTestObjectList(Page page,PageTestObjectDto pageTestObjectDto) throws Exception { + return Result.success(capacityScopeService.selectTestObjectList(page, pageTestObjectDto)); + } + + @ApiOperation(value = "娣诲姞妫�楠屽璞�") + @PostMapping("/addTestObject") + public Result addTestObject(@RequestBody StructureTestObject testObject) { + return Result.success(capacityScopeService.addTestObject(testObject)); + } + + @ApiOperation(value = "鍒犻櫎妫�楠屽璞�") + @PostMapping("/delTestObject") + public Result<?> delTestObject(Integer id) { + return Result.success(capacityScopeService.delTestObject(id)); + } + + @ApiOperation(value = "淇敼妫�楠屽璞�") + @PostMapping("/upTestObject") + public Result upTestObject(@RequestBody StructureTestObject testObject) { + return Result.success(capacityScopeService.upTestObject(testObject)); + } + + @ApiOperation(value = "鑾峰彇妫�楠屽璞℃灇涓�") + @GetMapping("/selectTestObjectByName") + public Result selectTestObjectByName() { + return Result.success(capacityScopeService.selectTestObjectByName()); + } + + @ApiOperation(value = "璁惧閲岄潰閫夋嫨妫�楠岄」鐩�(鏍戝舰缁撴瀯)") + @PostMapping("/getInsProduction") + public Result getInsProduction() { + return Result.success(capacityScopeService.getInsProduction()); + } + + @ApiOperation(value = "缁存姢妫�楠屽璞$殑浜у搧") + @PostMapping("/selectProductListByObjectId") + public Result selectProductListByObjectId(Page page,ProductDTO1 productDTO) throws Exception { + return Result.success(productService.selectProductListByObjectId(page, productDTO)); + } + + @ApiOperation(value = "娣诲姞浜у搧") + @PostMapping("/addProduct") + public Result addProduct(@RequestBody Product product) { + return Result.success(productService.addProduct(product)); + } + + @ApiOperation(value = "淇敼浜у搧") + @PostMapping("/upProduct") + public Result upProduct(@RequestBody Product product) { + return Result.success(productService.upProduct(product)); + } + + @ApiOperation(value = "鍒犻櫎浜у搧") + @PostMapping("/delProduct") + public Result delProduct(Integer id) { + return Result.success(productService.delProduct(id)); + } + + @ApiOperation(value = "鑾峰彇妫�楠屽璞℃爲") + @GetMapping("/getItemTree") + public Result getItemTree() { + return Result.success(capacityScopeService.getItemTree()); + } + + + @ApiOperation(value = "瑁呭瀵煎叆妫�楠岄」鐩�") + @PostMapping("/importEquipData") + @Transactional + public Result importEquipData(@RequestParam("file") MultipartFile file) throws Exception { + InputStream inputStream = file.getInputStream(); + List<StructureItemParameter> lists = new ArrayList<>(); + AtomicReference<String> sample = new AtomicReference<>(); + ExcelUtil.readBySax(inputStream, -1, (i, l, list1) -> { + if (l == 1) { + sample.set(list1.get(1) + ""); + } + if (l >= 1) { + StructureItemParameter str = new StructureItemParameter(); + // 娴嬭瘯瀵硅薄 + if (list1.get(1) == null) { + str.setSample(null); + } else { + String brand = (String) list1.get(1); + StringBuilder builder = new StringBuilder(); + builder.append("["); + // 浜у搧 + if (ObjectUtil.isNotEmpty(list1.get(2))) { + String production = (String) list1.get(2); + if (!production.contains("锛�")) { + builder.append(String.format("[\"%s\",\"%s\"]", brand, production)); + } else { + Arrays.stream(production.split("锛�")).forEach(item -> { + builder.append(String.format("[\"%s\",\"%s\"],", brand, item)); + }); + builder.deleteCharAt(builder.length() - 1); + } + } else { + builder.append("["); + builder.append(String.format("\"%s\"", brand)); + builder.append("]"); + } + builder.append("]"); + str.setSample(builder.toString()); + } + // 妫�楠岄」 + str.setInspectionItem(list1.get(4).toString().trim()); + // 妫�楠岄」鑻辨枃 + if (list1.get(5) != null) { + str.setInspectionItemEn(list1.get(5).toString()); + } + // 妫�楠屽瓙椤� + if (list1.get(6) == null) { + str.setInspectionItemSubclass(null); + } else { + str.setInspectionItemSubclass(list1.get(6).toString().trim()); + } + // 妫�楠屽瓙椤硅嫳鏂� + if (list1.get(7) == null) { + str.setInspectionItemSubclassEn(null); + } else { + str.setInspectionItemSubclassEn(String.valueOf(list1.get(7).toString())); + } + // 妫�楠岄」鍒嗙被 + if (list1.get(22) != null && list1.get(22) != "") { + str.setInspectionItemClass(list1.get(22).toString().trim()); + } else { + str.setInspectionItemClass(null); + } + // 妫�楠岄」鍒嗙被鑻辨枃 + if (list1.get(23) != null && list1.get(23) != "") { + str.setInspectionItemClassEn(list1.get(23) + ""); + } else { + str.setInspectionItemClassEn(null); + } + + LambdaQueryWrapper<StructureItemParameter> wrapper = Wrappers.lambdaQuery(StructureItemParameter.class) + .eq(StructureItemParameter::getInspectionItem, str.getInspectionItem()) + .eq(StructureItemParameter::getSample, str.getSample()) + + .last("limit 1"); + // 鍒ゆ柇鏄惁鏈夋楠岄」绫诲瀷 + if (ObjectUtils.isNotEmpty(str.getInspectionItemClass())) { + wrapper.eq(StructureItemParameter::getInspectionItemClass, str.getInspectionItemClass()); + } + + // 鍒ゆ柇鏄惁鏈夋楠屽瓙椤� + if (ObjectUtils.isNotEmpty(str.getInspectionItemSubclass())) { + wrapper.eq(StructureItemParameter::getInspectionItemSubclass, str.getInspectionItemSubclass()); + } + StructureItemParameter db_str = structureItemParameterService.getOne(wrapper); + if (ObjectUtils.isNotEmpty(db_str)) { + str.setId(db_str.getId()); + } + // 鏂规硶鍚嶇О + if (list1.get(8) == null) { + str.setMethod(null); + } else { + StringBuffer buffer = new StringBuffer(); + String input = list1.get(8).toString(); + buffer.append("["); + String[] values = input.split("锛�"); + for (String value : values) { + buffer.append("\"").append(value.trim()).append("\","); + } + buffer.deleteCharAt(buffer.length() - 1); + buffer.append("]"); + str.setMethod(buffer.toString()); + } + // 璇曢獙瀹� + if (list1.get(9) == null) { + str.setSonLaboratory(null); + } else { + str.setSonLaboratory(list1.get(9).toString()); + } + // 璁¢噺鍗曚綅 + if (list1.get(10) == null) { + str.setUnit(null); + } else { + str.setUnit(list1.get(10).toString()); + } + // 瑕佹眰鍊� + if (list1.get(11) == null) { + str.setAskTell(null); + } else { + str.setAskTell(list1.get(11).toString()); + } + // 瑕佹眰鎻忚堪 + if (list1.get(12) == null) { + str.setAsk(null); + } else { + str.setAsk(list1.get(12).toString()); + } + // 鍗曚环 + if (list1.get(13) == null) { + str.setPrice(null); + } else { + str.setPrice(list1.get(13) + ""); + } + // 宸ユ椂绯绘暟 + if (list1.get(14) == null) { + str.setManHour(null); + } else { + str.setManHour(Double.valueOf(list1.get(14).toString())); + } + // 宸ユ椂鍒嗙粍 + if (list1.get(15) == null) { + str.setManHourGroup(null); + } else { + str.setManHourGroup(list1.get(15).toString()); + } + // 棰勮瀹屾垚鏃堕棿 + if (list1.get(16) == null) { + str.setManDay(null); + } else { + str.setManDay(Integer.valueOf(list1.get(16).toString())); + } + // 鏁版嵁绫诲瀷 + String jy; + if (list1.get(17).toString().equals("闈為噰闆嗙被鍨�")) { + jy = "0"; + } else { + jy = "1"; + } + str.setInspectionItemType(jy); + // 妫�楠岄」绫诲瀷 + String validateValueType = list1.get(18).toString(); + if (ObjectUtils.isNotEmpty(validateValueType)) { + List<SysDictData> enums = dictTypeService.selectDictDataByName("妫�楠屽�肩被鍨�") + .stream().filter(sysDictData -> sysDictData.getDictLabel().equals(validateValueType)).collect(Collectors.toList()); + str.setInspectionValueType(enums.get(0).getDictValue()); + } + int bsm; + //鐗规畩鏍囪瘑 + if (list1.get(19).toString().equals("鍚�")) { + bsm = 0; + } else { + bsm = 1; + } + str.setBsm(bsm + ""); + // 鏁板瓧瀛楀吀 + if (list1.get(20) != null) { + str.setDic(list1.get(20) + ""); + } else { + str.setDic(null); + } + // 鍘熷璁板綍妯℃澘 + StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list1.get(21))); + if (standTempIdByName != null) { + str.setTemplateId(standTempIdByName.getId()); + } else { + str.setTemplateId(null); + } + try { + if (list1.get(24) != null) { + str.setLaboratory(list1.get(24) + ""); + } + } catch (Exception e) { + } + + // 鏉′欢 + if (list1.get(25) == null) { + str.setRadiusList(null); + } else { + StringBuffer buffer = new StringBuffer(); + String input = list1.get(25).toString(); + buffer.append("["); + String[] values = input.split("锛�"); + for (String value : values) { + buffer.append("\"").append(value.trim()).append("\","); + } + buffer.deleteCharAt(buffer.length() - 1); + buffer.append("]"); + str.setRadiusList(buffer.toString()); + } + // 鏀惰垂鏍囧噯 + if (list1.get(26) == null) { + str.setRates(null); + } else { + str.setRates(list1.get(26) + ""); + } + + lists.add(str); + } + }); +// structureItemParameterService.removeNoSample(sample.get()); + // 濡傛灉鏁版嵁搴撻噷闈㈢殑鏁版嵁瀛樺湪閭d箞灏辨墽琛屾洿鏂版嫹璐濇搷浣� + try { + structureItemParameterService.saveOrUpdateBatch(lists); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("鏈嶅姟绔姤閿�"); + } + return Result.success(); + } + + @ApiOperation(value = "瀵煎叆妫�楠屽璞�") + @PostMapping("/importExcel") + public Result importExcel(@RequestParam("file") MultipartFile file) { + try { + EasyExcel.read(file.getInputStream(), StructureTestObjectData.class, new StructureTestObjectListener(productService)).sheet().doRead(); + } catch (IOException e) { + e.printStackTrace(); + } + return Result.success(); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/CertificationController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/CertificationController.java new file mode 100644 index 0000000..51ed763 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/CertificationController.java @@ -0,0 +1,41 @@ +package com.ruoyi.basic.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.Certification; +import com.ruoyi.basic.service.CertificationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Api(tags = "璧勮川璇存槑") +@AllArgsConstructor +@RestController +@RequestMapping("/certification") + +public class CertificationController { + + private CertificationService certificationService; + + + @ApiOperation(value = "鏌ヨ璧勮川鏄庣粏鍒楄〃") + @PostMapping("/getCertificationDetail") + public Result getCertificationDetail(Page page,Certification certification) { + return Result.success(certificationService.getCertificationDetail(page, certification)); + } + + @ApiOperation(value = "娣诲姞璧勮川鏄庣粏鍒楄〃") + @PostMapping("/addCertificationDetail") + public Result addCertificationDetail(@RequestBody Certification certification) { + return Result.success(certificationService.addCertificationDetail(certification)); + } + @ApiOperation(value = "鍒犻櫎璧勮川鏄庣粏鍒楄〃") + @PostMapping("/delCertificationDetail") + public Result<?> delCertificationDetail( String ids) { + return Result.success(certificationService.delCertificationDetail(ids)); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/LaboratoryController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/LaboratoryController.java new file mode 100644 index 0000000..c21f7be --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/LaboratoryController.java @@ -0,0 +1,62 @@ +package com.ruoyi.basic.controller; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.Laboratory; +import com.ruoyi.basic.service.LaboratoryService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * 瀹為獙瀹ょ鐞�(LaboratoryController)琛ㄦ帶鍒跺眰 + */ +@Api(tags = "鍦烘墍鎴栬鏂�") + +@RestController +@RequestMapping("/laboratoryScope") +public class LaboratoryController { + + @Resource + private LaboratoryService laboratoryService; + + @ApiOperation(value = "鏌ヨ瀹為獙瀹ょ鐞嗗垪琛�") + @PostMapping("/selectItemParameter") + public Result selectItemParameter(Page page ,Laboratory itemParameter) { + return Result.success(laboratoryService.selectItemParameter(page, itemParameter)); + } + + @ApiOperation(value = "娣诲姞瀹為獙瀹ゅ弬鏁�") + @PostMapping("/addParameter") + public Result addParameter(@RequestBody Laboratory itemParameter) { + return Result.success(laboratoryService.addParameter(itemParameter)); + } + + @ApiOperation(value = "鍒犻櫎瀹為獙瀹ゅ弬鏁�") + @PostMapping("/delParameter") + public Result<?> delParameter(Integer id) { + return Result.success(laboratoryService.delParameter(id)); + } + + @ApiOperation(value = "淇敼瀹為獙瀹ゅ弬鏁�") + @PostMapping("/upParameter") + public Result<?> upParameter(@RequestBody Laboratory itemParameter) { + return Result.success(laboratoryService.upParameter(itemParameter)); + } + + @ApiOperation(value = "鑾峰彇瀹為獙瀹ゅ悕绉�") + @GetMapping("/obtainItemParameterList") + public Result obtainItemParameterList() { + return Result.success(laboratoryService.obtainItemParameterList()); + } +} + + + + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java new file mode 100644 index 0000000..ca3a5b9 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java @@ -0,0 +1,50 @@ +package com.ruoyi.basic.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.ProductPart; +import com.ruoyi.basic.service.ProductPartService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@AllArgsConstructor +@RequestMapping("/productPart") +@Api(tags = "浜у搧闆朵欢缁戝畾") +public class ProductPartController { + + private ProductPartService productPartService; + + @ApiOperation(value = "鏍规嵁浜у搧id鏌ヨ闆朵欢") + @PostMapping("/selectByProductId") + public Result selectByProductId(Page page,ProductPart productPart){ + return Result.success(productPartService.selectByProductId(page,productPart)); + } + + @ApiOperation(value = "鏂板浜у搧闆朵欢") + @PostMapping("/addProductPart") + public Result addProductPart(@RequestBody ProductPart productPart) { + productPartService.addProductPart(productPart); + return Result.success(); + } + + @ApiOperation(value = "鏇存柊浜у搧闆朵欢") + @PostMapping("/updateProductPart") + public Result updateProductPart(@RequestBody ProductPart productPart) { + productPartService.updateProductPartById(productPart); + return Result.success(); + } + + @ApiOperation(value = "鍒犻櫎浜у搧闆朵欢") + @PostMapping("/deleteProductPart") + public Result deleteProductPart(Integer id) { + productPartService.removeById(id); + return Result.success(); + } + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/ProductSupplierDensityController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/ProductSupplierDensityController.java new file mode 100644 index 0000000..1d86970 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/ProductSupplierDensityController.java @@ -0,0 +1,59 @@ +package com.ruoyi.basic.controller; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.ProductSupplierDensity; +import com.ruoyi.basic.service.ProductSupplierDensityService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 浜у搧鍘傚瀵嗗害缁戝畾琛� + * + * @author zhuo + * @since 2024-09-19 + */ +@RestController +@RequestMapping("/productSupplierDensity") +@AllArgsConstructor +@Api(tags = "浜у搧鍘傚瀵嗗害缁戝畾") +public class ProductSupplierDensityController { + + private ProductSupplierDensityService productSupplierDensityService; + + @ApiOperation(value = "鏍规嵁浜у搧id鏌ヨ鍘傚瀵嗗害缁戝畾") + @PostMapping("/selectSupplierDensityByProductId") + public Result selectSupplierDensityByProductId(Page page,ProductSupplierDensity supplierDensity) { + return Result.success(productSupplierDensityService.selectByProductId(page, supplierDensity)); + } + + @ApiOperation(value = "鏂板鍘傚瀵嗗害缁戝畾") + @PostMapping("/addProductSupplierDensity") + public Result addProductSupplierDensity(@RequestBody ProductSupplierDensity supplierDensity) { + productSupplierDensityService.addProductSupplierDensity(supplierDensity); + return Result.success(); + } + + @ApiOperation(value = "鏇存柊鍘傚瀵嗗害缁戝畾") + @PostMapping("/updateProductSupplierDensity") + public Result updateProductSupplierDensity(@RequestBody ProductSupplierDensity supplierDensity) { + productSupplierDensityService.updateProductSupplierDensity(supplierDensity); + return Result.success(); + } + + @ApiOperation(value = "鍒犻櫎鍘傚瀵嗗害缁戝畾") + @PostMapping("/deleteProductSupplierDensity") + public Result deleteProductSupplierDensity(Integer id) { + productSupplierDensityService.removeById(id); + return Result.success(); + } + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/StandardMethodController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/StandardMethodController.java new file mode 100644 index 0000000..f74f38b --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/StandardMethodController.java @@ -0,0 +1,59 @@ +package com.ruoyi.basic.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.StandardMethod; +import com.ruoyi.basic.service.StandardMethodService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; + +@Api(tags = "鏍囧噯鏂规硶") +@RestController +@RequestMapping("/standardMethod") +@AllArgsConstructor +public class StandardMethodController { + + private StandardMethodService standardMethodService; + + @ApiOperation(value = "鑾峰彇鏍囧噯鏂规硶鍒楄〃") + @PostMapping("/selectStandardMethodList") + public Result selectStandardMethodList(Page page,StandardMethod standardMethod) throws Exception { + return Result.success(standardMethodService.selectStandardMethodList(page, standardMethod)); + } + + @ApiOperation(value = "鑾峰彇鏍囧噯鏂规硶鏋氫妇") + @GetMapping("/selectStandardMethods") + public Result selectStandardMethods(){ + return Result.success(standardMethodService.selectStandardMethods()); + } + + @ApiOperation(value = "娣诲姞鏍囧噯鏂规硶") + @PostMapping("/addStandardMethod") + public Result addStandardMethod(@RequestBody StandardMethod standardMethod) { + return Result.success(standardMethodService.addStandardMethod(standardMethod)); + } + + @ApiOperation(value = "鍒犻櫎鏍囧噯鏂规硶") + @PostMapping("/delStandardMethod") + public Result<?> delStandardMethod(Integer id) { + return Result.success(standardMethodService.delStandardMethod(id)); + } + + @ApiOperation(value = "淇敼鏍囧噯鏂规硶") + @PostMapping("/upStandardMethod") + public Result<?> upStandardMethod(@RequestBody StandardMethod standardMethod) { + 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(); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/StandardTemplateController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/StandardTemplateController.java new file mode 100644 index 0000000..c14f1a3 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/StandardTemplateController.java @@ -0,0 +1,68 @@ +package com.ruoyi.basic.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.StandardTemplate; +import com.ruoyi.basic.service.StandardTemplateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +@RequestMapping("/StandardTemplate") +@RestController +@AllArgsConstructor +@Api(tags = "鍘熷璁板綍妯℃澘") +public class StandardTemplateController { + + private StandardTemplateService standardTemplateService; + + @ApiOperation(value = "鑾峰彇鍘熷璁板綍妯℃澘鍒楄〃") + @PostMapping("/selectStandardTemplatePageList") + public Result selectStandardTemplatePageList(Page page,StandardTemplate standardTemplate) throws Exception { + return Result.success(standardTemplateService.selectStandardTemplatePageList(page, standardTemplate)); + } + + @ApiOperation(value = "娣诲姞鍘熷璁板綍妯℃澘") + @PostMapping("/addStandardTemplate") + public Result addStandardTemplate(@RequestBody StandardTemplate standardTemplate) { + return Result.success(standardTemplateService.addStandardTemplate(standardTemplate)); + } + + @ApiOperation(value = "淇敼鍘熷璁板綍妯℃澘") + @PostMapping("/upStandardTemplate") + public Result<?> upStandardTemplate(@RequestBody StandardTemplate standardTemplate) { + return Result.success(standardTemplateService.upStandardTemplate(standardTemplate)); + } + + @ApiOperation(value = "鍒犻櫎鍘熷璁板綍妯℃澘") + @PostMapping("/delStandardTemplate") + public Result<?> delStandardTemplate(Integer id) { + return Result.success(standardTemplateService.delStandardTemplate(id)); + } + + @ApiOperation(value = "鏌ヨ鍘熷璁板綍妯℃澘鏋氫妇") + @GetMapping("/getStandardTemplate") + public Result<?> getStandardTemplate() { + return Result.success(standardTemplateService.getStandardTemplate()); + } + + @ApiOperation(value = "閫氳繃妯℃澘id鑾峰彇妫�楠岄」妯℃澘鍐呭") + @PostMapping("/getStandTempThingById") + public Result<?> getStandTempThingById(Integer id) { + return Result.success(standardTemplateService.getStandTempThingById(id)); + } + + @ApiOperation(value = "缂栬緫妯℃澘缂栧埗") + @GetMapping("/getEditTemplatePreparation") + public Result<?> getEditTemplatePreparation(@RequestParam("id") Integer id) { + StandardTemplate byId = standardTemplateService.getById(id); + return Result.success("OK", byId.getThing()); + } + + @ApiOperation(value = "澶嶅埗鍘熷璁板綍妯℃澘") + @PostMapping("/copyStandardTemplate") + public Result copyStandardTemplate(@RequestBody StandardTemplate newTemplate) { + return Result.success(standardTemplateService.copyStandardTemplate(newTemplate)); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java new file mode 100644 index 0000000..d24ae09 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java @@ -0,0 +1,276 @@ +package com.ruoyi.basic.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.dto.CopyStandardProductListDto; +import com.ruoyi.basic.dto.FactoryDto; +import com.ruoyi.basic.dto.InsSampleReceiveDto; +import com.ruoyi.basic.dto.ResetTreeDragDTO; +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; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +@RestController +@AllArgsConstructor +@RequestMapping("/standardTree") +@Api(tags = "鏍囧噯搴�") +public class StandardTreeController { + + private StandardTreeService standardTreeService; + + private StandardMethodListService standardMethodListService; + + private StandardProductListService standardProductListService; + + private StandardProductListSupplierAskService standardProductListSupplierAskService; + + @ApiOperation(value = "鑾峰彇鏍囧噯鏍�") + @GetMapping("/selectStandardTreeList") + public Result selectStandardTreeList() { + return Result.success(standardTreeService.selectStandardTreeList()); + } + + @ApiOperation(value = "鑾峰彇鏍囧噯鏍�(妫�楠屼笅鍗�)") + @GetMapping("/selectStandardTreeList2") + public Result selectStandardTreeList2() { + return Result.success(standardTreeService.selectStandardTreeList()); + } + + @ApiOperation(value = "娣诲姞鏍囧噯鏍�") + @PostMapping("/addStandardTree") + public Result addStandardTree(@RequestBody StandardTree standardTree) { + return Result.success(standardTreeService.addStandardTree(standardTree)); + } + + @ApiOperation(value = "缁欐爣鍑嗘爲娣诲姞妫�楠屾爣鍑�") + @PostMapping("/addStandardMethodList") + public Result addStandardMethodList(String tree, Integer standardId) { + return Result.success(standardMethodListService.addStandardMethodList(standardId, tree)); + } + + @ApiOperation(value = "鏍规嵁鏍囧噯鏍戣繘琛屾爣鍑嗘煡璇�") + @PostMapping("/selectsStandardMethodByFLSSM") + public Result selectsStandardMethodByFLSSM(String tree) { + return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); + } + + @ApiOperation(value = "淇敼鏍囧噯搴撲腑鐨勫唴瀹�") + @PostMapping("/upStandardProductList") + public Result upStandardProductList(String str) { + StandardProductList list = JSON.parseObject(str, StandardProductList.class); + return Result.success(standardProductListService.upStandardProductList(list)); + } + + @ApiOperation(value = "淇敼鏍囧噯搴撳尯闂�") + @PostMapping("/updateSection") + public Result updateSection(String str) { + StandardProductList list = JSON.parseObject(str, StandardProductList.class); + return Result.success(standardProductListService.updateSection(list)); + } + + @ApiOperation(value = "鍒犻櫎鏍囧噯鏍戜笅鐨勬楠屾爣鍑�") + @PostMapping("/delStandardMethodByFLSSM") + public Result delStandardMethodByFLSSM(Integer id) { + return Result.success(standardMethodListService.delStandardMethodByFLSSM(id)); + } + + @ApiOperation(value = "鍒犻櫎鏍囧噯鏍戜笅鐨勬楠岄」鐩�") + @PostMapping("/delStandardProductByIds") + public Result delStandardProductByIds(String ids) { + JSONArray lists = JSON.parseArray(ids); + return Result.success(standardProductListService.delStandardProduct(lists)); + } + + @ApiOperation(value = "鏂板鏍囧噯鏍戜笅鐨勬楠岄」鐩�") + @PostMapping("/addStandardProduct") + public Result addStandardProduct(String ids, String tree) { + return Result.success(standardTreeService.addStandardProduct(ids, tree)); + } + + @ApiOperation(value = "鍒犻櫎鏍囧噯鏍戠殑灞傜骇") + @PostMapping("/delStandardTree") + public Result delStandardTree(String tree) { + return Result.success(standardTreeService.delStandardTree(tree)); + } + + @ApiOperation(value = "閫氳繃鏍囧噯鏍戞煡璇㈠搴旂殑妫�楠岄」鐩�") + @PostMapping("/selectStandardProductList") + public Result selectStandardProductList(@RequestBody InsSampleReceiveDto insSample) { + return Result.success(standardProductListService.selectStandardProductList(insSample)); + } + + @ApiOperation(value = "閫氳繃妫�楠屾爣鍑嗘煡璇㈡楠岄」鐩�") + @PostMapping("/selectStandardProductListByMethodId") + public Result selectStandardProductListByMethodId(Integer id, String tree, Integer page) { + return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree, page)); + } + + @ApiOperation(value = "鎵归噺缂栬緫鏌ヨ妫�楠岄」鐩�") + @PostMapping("/selectStandardProductByMethodId") + public Result selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items) { + return Result.success(standardProductListService.selectStandardProductByMethodId(id, tree, page, laboratory, item, items)); + } + + @ApiOperation(value = "鎵归噺缂栬緫鏌ヨ鎵�鏈夋楠岄」鐩拰妫�楠屽瓙椤规灇涓�") + @PostMapping("/selectStandardProductEnumByMethodId") + public Result selectStandardProductEnumByMethodId(Integer id, String tree, String item) { + return Result.success(standardProductListService.selectStandardProductEnumByMethodId(id, tree, item)); + } + + @ApiOperation(value = "鑾峰彇鏍囧噯鏍戜笅鏍囧噯鏂规硶鏋氫妇") + @GetMapping("/selectStandardMethodEnum") + public Result selectStandardMethodEnum() { + return Result.success(standardMethodListService.selectStandardMethodEnum()); + } + + @ApiOperation(value = "鑾峰彇浜у搧鏋舵瀯") + @GetMapping("/getStandardTree2") + public Result getStandardTree2() { + return Result.success(standardTreeService.getStandardTree2()); + } + + @ApiOperation(value = "鎵归噺淇敼椤圭洰鍐呭") + @PostMapping("/upStandardProducts") + @ApiImplicitParams({ + @ApiImplicitParam(name = "standardProductList", dataTypeClass = StandardProductList.class), + @ApiImplicitParam(name = "ids", dataTypeClass = Integer.class) + }) + public Result upStandardProducts(@RequestBody Map<String, Object> product) { + return Result.success(standardTreeService.upStandardProducts(product)); + } + + @PostMapping("/getStandTreeBySampleType") + @ApiOperation("浠呰幏鍙栧厜绾ょ殑鍨嬪彿") + 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(String tree, Integer standardId) { + standardTreeService.resetTreeOfPrice(tree, standardId); + return Result.success(); + } + + @ApiOperation("閲嶇疆鏍囧噯搴撳伐鏃剁郴鏁�") + @PostMapping("/resetTreeOfHour") + public Result resetTreeOfHour(String tree, Integer standardId) { + standardTreeService.resetTreeOfHour(tree, standardId); + return Result.success(); + } + + @ApiOperation("閲嶇疆鏍囧噯搴撹姹傛弿杩板拰瑕佹眰鍊�") + @PostMapping("/resetTreeOfAsk") + public Result resetTreeOfAsk(String tree, Integer standardId) { + standardTreeService.resetTreeOfAsk(tree, standardId); + return Result.success(); + } + + @ApiOperation("鏍囧噯搴撴嫋鎷�") + @PostMapping("/resetTreeDrag") + public Result resetTreeDrag(@RequestBody ResetTreeDragDTO resetTreeDragDTO) { + standardProductListService.resetTreeDrag(resetTreeDragDTO); + return Result.success(); + } + + @ApiOperation("鏍囧噯搴撴嫋鎷藉叏閮�") + @PostMapping("/resetTreeDragBatch") + public Result resetTreeDragBatch(@RequestBody Map<String, Object> params) { + List<StandardProductList> standardProductLists = (List<StandardProductList>) params.get("params"); + standardProductListService.resetTreeDragBatch(standardProductLists); + return Result.success(); + } + + @ApiOperation(value = "鏍囧噯鏍戞帓搴�") + @PostMapping("/updateTreeSort") + public Result updateTreeSort(@RequestBody List<FactoryDto> list) { + return Result.success(standardTreeService.updateTreeSort(list)); + } + + /*************************************************** 鍘傚鐗规畩瑕佹眰鍊煎鐞� ************************************************************/ + + @ApiOperation(value = "鏍规嵁浜у搧id鏌ヨ鍘傚瑕佹眰鍊肩粦瀹�") + @PostMapping("/selectSupplierAsk") + public Result selectSupplierAsk(StandardProductListSupplierAsk supplierAsk) throws Exception { + return Result.success(standardProductListSupplierAskService.selectByProductId(supplierAsk)); + } + + @ApiOperation(value = "鏂板鍘傚瑕佹眰鍊肩粦瀹�") + @PostMapping("/addProductSupplierAsk") + public Result addProductSupplierAsk(String str) { + StandardProductListSupplierAsk supplierAsk = JSON.parseObject(str, StandardProductListSupplierAsk.class); + return Result.success(standardProductListSupplierAskService.addProductSupplierAsk(supplierAsk)); + } + + @ApiOperation(value = "鏇存柊鍘傚瑕佹眰鍊肩粦瀹�") + @PostMapping("/updateProductSupplierAsk") + public Result updateProductSupplierAsk(String str) { + StandardProductListSupplierAsk supplierAsk = JSON.parseObject(str, StandardProductListSupplierAsk.class); + standardProductListSupplierAskService.updateProductSupplierAsk(supplierAsk); + return Result.success(); + } + + @ApiOperation(value = "鍒犻櫎鍘傚瑕佹眰鍊肩粦瀹�") + @PostMapping("/deleteProductSupplierAsk") + public Result deleteProductSupplierAsk(Integer supplierAskId) { + standardProductListSupplierAskService.removeById(supplierAskId); + return Result.success(); + } + + @ApiOperation(value = "淇敼鏍囧噯鏍�") + @PostMapping("/updateStandardTree") + public Result updateStandardTree(@RequestBody StandardTree standardTree) { + return Result.success(standardTreeService.updateStandardTree(standardTree)); + } + + @ApiOperation(value = "妫�楠岄」瑕佹眰鍊煎鍒跺姣�") + @PostMapping("/copyStandardProductList") + public Result copyStandardProductList(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { + return Result.success(standardProductListService.copyStandardProductList(copyStandardProductListDto)); + } + + @ApiOperation(value = "妫�楠岄」瑕佹眰鍊煎崟鐙姣�") + @PostMapping("/copyStandardProductOne") + public Result copyStandardProductOne(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { + return Result.success(standardProductListService.copyStandardProductOne(copyStandardProductListDto)); + } + + @ApiOperation(value = "妫�楠岄」鎵归噺淇敼瑕佹眰鍊艰姹傛弿杩�") + @PostMapping("/updateStandardProductListBatch") + public Result updateStandardProductListBatch(@RequestBody Map<String, Object> param) { + List<StandardProductList> standardProductList = (List<StandardProductList>) param.get("standardProductList"); + return Result.success(standardProductListService.updateBatchById(standardProductList)); + } + + @ApiOperation(value = "妫�楠岄」澶嶅埗鎺掑簭") + @PostMapping("/copyStandardProductSort") + public Result copyStandardProductSort(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { + return Result.success(standardProductListService.copyStandardProductSort(copyStandardProductListDto)); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java new file mode 100644 index 0000000..5a073e8 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java @@ -0,0 +1,59 @@ +package com.ruoyi.basic.controller; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.basic.pojo.StructureTestObjectPart; +import com.ruoyi.basic.service.StructureTestObjectPartService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 妫�楠屽璞¢浂浠惰〃 + * + * @author zhuo + * @since 2024-08-07 + */ +@RestController +@RequestMapping("/structureTestObjectPart") +@AllArgsConstructor +@Api(tags = "妫�楠屽璞¢浂浠惰〃") +public class StructureTestObjectPartController { + + private StructureTestObjectPartService structureTestObjectPartService; + + @ApiOperation(value = "鏍规嵁妫�楠屽璞d鏌ヨ闆朵欢") + @PostMapping("/selectByTestObjectId") + public Result selectByTestObjectId(Page page,StructureTestObjectPart structureTestObjectPart){ + return Result.success(structureTestObjectPartService.selectByTestObjectId(page,structureTestObjectPart)); + } + + @ApiOperation(value = "鏂板妫�楠屽璞¢浂浠�") + @PostMapping("/addTestObjectPart") + public Result addTestObjectPart(@RequestBody StructureTestObjectPart structureTestObjectPart) { + structureTestObjectPartService.addTestObjectPart(structureTestObjectPart); + return Result.success(); + } + + @ApiOperation(value = "鏇存柊妫�楠屽璞¢浂浠�") + @PostMapping("/updateTestObjectPart") + public Result updateTestObjectPart(@RequestBody StructureTestObjectPart structureTestObjectPart) { + structureTestObjectPartService.updateTestObjectPart(structureTestObjectPart); + return Result.success(); + } + + @ApiOperation(value = "鍒犻櫎妫�楠屽璞¢浂浠�") + @PostMapping("/deleteTestObjectPart") + public Result deleteTestObjectPart(Integer id) { + structureTestObjectPartService.removeById(id); + return Result.success(); + } + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/CopyStandardProductListDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/CopyStandardProductListDto.java new file mode 100644 index 0000000..7287adb --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/CopyStandardProductListDto.java @@ -0,0 +1,23 @@ +package com.ruoyi.basic.dto; + +import com.ruoyi.basic.pojo.StandardProductList; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 鏍囧噯妫�楠岄」澶嶅埗 + * + * @Author zhuo + * @Date 2024/10/31 + */ +@Data +public class CopyStandardProductListDto { + + @ApiModelProperty("鍘熸湰妫�楠岄」淇℃伅") + private List<StandardProductList> oldStandardProductList; + + @ApiModelProperty("闇�瑕佸姣旂殑妫�楠岄」淇℃伅") + private List<StandardProductList> newStandardProductList; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/FactoryDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/FactoryDto.java new file mode 100644 index 0000000..612bcf8 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/FactoryDto.java @@ -0,0 +1,18 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class FactoryDto { + + private String code = "[1]"; + + private String label; + + private String value; + + private List<LaboratoryDto> children; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityCheckDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityCheckDto.java new file mode 100644 index 0000000..db5c582 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityCheckDto.java @@ -0,0 +1,182 @@ +package com.ruoyi.basic.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 鍘熸潗鏂欐煡璇�, 鎺掗櫎浜嗕緵搴斿晢 + * @Author zhuo + * @Date 2024/8/28 + */ +@Data +public class IfsInventoryQuantityCheckDto implements Serializable { + + private Integer id; + + @ApiModelProperty("鍩�") + private String contract; + + @ApiModelProperty("璁㈠崟鍙�") + private String orderNo; + + + @ApiModelProperty("琛屽彿") + private String lineNo; + + @ApiModelProperty("涓嬭揪鍙�") + private String releaseNo; + + @ApiModelProperty("鎺ユ敹鍙�") + private Integer receiptNo; + + @ApiModelProperty("闆朵欢鍙�") + private String partNo; + + @ApiModelProperty("闆朵欢鎻忚堪") + private String partDesc; + + @ApiModelProperty("鐘舵�佹弿杩�") + private String status; + + @ApiModelProperty("鐘舵��") + private String statusDb; + + @ApiModelProperty("鎶佃揪鐨勯噰璐暟閲�") + private BigDecimal qtyArrived; + + @ApiModelProperty("宸叉楠岀殑璐拱鏁伴噺") + private BigDecimal qtyInspected; + + @ApiModelProperty("瑕佹楠岀殑閲囪喘鏁伴噺") + private BigDecimal qtyToInspect; + + @ApiModelProperty("鎶佃揪鐨勫簱瀛樻暟閲�") + private BigDecimal invQtyInStore; + + @ApiModelProperty("鎶佃揪鐨勯噰璐暟閲�") + private BigDecimal purQtyInStore; + + @ApiModelProperty("閰嶇疆鏍囪瘑") + private String configurationId; + + @ApiModelProperty("鎵瑰彿") + private String lotBatchNo; + + @ApiModelProperty("wdr鍙�") + private String waivDevRejNo; + + @ApiModelProperty("娲诲姩搴忓垪") + private Integer activitySeq; + + + @ApiModelProperty("搴忓垪鍙�") + private String serialNo; + + @ApiModelProperty("搴撲綅鍙�") + private String locationNo; + + @ApiModelProperty("鐗堟湰鍙�") + private String engChgLevel; + + @ApiModelProperty("鎺ユ敹浜�") + private String receiver; + + @ApiModelProperty("鎺ユ敹浜哄鍚�") + private String receiverName; + + @ApiModelProperty("閲囪喘鍛�") + private String buyerCode; + + @ApiModelProperty("閲囪喘鍛樺鍚�") + private String buyerName; + + @ApiModelProperty("瀹為檯鍒拌揣鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime arriveDate; + + @ApiModelProperty("瀹為檯浜よ揣鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime deliveryDate; + + @ApiModelProperty("鐢熶骇鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime productDate; + + @ApiModelProperty("澶辨晥鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime invalidDate; + + + @ApiModelProperty("瀹℃壒鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvedDate; + + @ApiModelProperty("閲囪喘鐢宠鍒涘缓浜�") + private String reqCeater; + + @ApiModelProperty("閲囪喘鐢宠鍒涘缓浜哄鍚�") + private String reqCeaterName; + + @ApiModelProperty("閲囪喘璁㈠崟琛屽娉�") + private String lineRemarks; + + @ApiModelProperty("鍗曚綅") + private String buyUnitMeas; + + + private Integer isSource; + + private Integer number; + + + private Integer state; + + @ApiModelProperty("鎺ユ敹鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime receiverDate; + + @ApiModelProperty("鏄惁涓洪娆″嚭鐜� 0 鍚� 1 鏄�") + private Integer isFirst; + + @ApiModelProperty("鐩爣搴撲綅鍙�") + private String toLocation; + + @ApiModelProperty("鏄惁鏄姤妫� 0 鍚� 1 鏄�") + private Integer isInspect; + + @ApiModelProperty("鎶ユ浜�") + private String declareUser; + + + @ApiModelProperty("鎶ユ浜篿d") + private Integer declareUserId; + + @ApiModelProperty("鍗曚綅") + private String partUnit; + + @ApiModelProperty("浜т笟閾炬娴嬫暟鎹�") + private String industryChain; + + @ApiModelProperty("鎶ユ鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime declareDate; + + @ApiModelProperty("鏄惁鍗″彲浠ュ搴︽楠� 0 鍚� 1 鏄�") + private Integer isQuarter; + + // 淇敼鍚庣殑 + @ApiModelProperty("鎵瑰彿") + private String updateBatchNo; + + @ApiModelProperty("鏄惁鏄摐鍗曚笣, 0鍚�, 1鏄�") + private Integer isCopper; + + @ApiModelProperty("鐗╂枡绫诲瀷") + private Integer isExpire; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java new file mode 100644 index 0000000..237224e --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java @@ -0,0 +1,82 @@ +package com.ruoyi.basic.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class IfsInventoryQuantityDto extends IfsInventoryQuantityCheckDto { + + /** + * 濮旀墭缂栧彿 + */ + @ApiModelProperty("濮旀墭缂栧彿") + private String entrustCode; + + @ApiModelProperty("妫�楠屽璞�") + private String sampleType; + + @ApiModelProperty("鏍峰搧鍚嶇О") + private String sampleName; + + @ApiModelProperty("鏍峰搧鍨嬪彿") + private String sampleModel; + + @ApiModelProperty("鏍峰搧缂栧彿") + private String sampleCode; + + // 杩涘巶 + @ApiModelProperty("璁㈠崟id") + private Integer enterOrderId; + + @ApiModelProperty("鎶ュ憡id") + private String enterReportId; + + @ApiModelProperty("绯荤粺鐢熸垚鎶ュ憡鍦板潃") + private String enterUrl; + + @ApiModelProperty("鎵嬪姩涓婁紶鎶ュ憡鍦板潃") + private String enterUrlS; + + // 瀛e害 + @ApiModelProperty("璁㈠崟id") + private Integer quarterOrderId; + + @ApiModelProperty("鎶ュ憡id") + private String quarterReportId; + + @ApiModelProperty("绯荤粺鐢熸垚鎶ュ憡鍦板潃") + private String quarterUrl; + + @ApiModelProperty("鎵嬪姩涓婁紶鎶ュ憡鍦板潃") + private String quarterUrlS; + + private Integer orderState; + + @ApiModelProperty("涓嬪彂鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime sendTime; + + @ApiModelProperty("鏉愭枡鍘傚") + private String supplierName; + + @ApiModelProperty("濮旀墭浜�") + private String prepareUser; + + @ApiModelProperty("棰滆壊") + private String color; + + @ApiModelProperty("鏍囩鐘舵��") + private String labelStatus; + + @ApiModelProperty("鏍囩鏉″舰鐮�") + private String labelBarCode; + + @ApiModelProperty("鍒涘缓浜�") + private Integer createUser; + + @ApiModelProperty("妫�楠屼汉") + private String userName; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java new file mode 100644 index 0000000..71bfddb --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java @@ -0,0 +1,124 @@ +package com.ruoyi.basic.dto; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.basic.pojo.IfsInventoryQuantity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 鑳芥煡璇㈠埌渚涘簲鍟� + */ +@Data +@ExcelIgnoreUnannotated +public class IfsInventoryQuantitySupplierDto extends IfsInventoryQuantity { + + /** + * 濮旀墭缂栧彿 + */ + @ExcelProperty(index = 2, value = "濮旀墭缂栧彿") + @ApiModelProperty("濮旀墭缂栧彿") + private String entrustCode; + + @ApiModelProperty("鏍峰搧id") + private Integer sampleId; + + @ApiModelProperty("妫�楠屽璞�") + private String sampleType; + + @ExcelProperty(index = 7, value = "鏍峰搧鍚嶇О") + @ApiModelProperty("鏍峰搧鍚嶇О") + private String sampleName; + + @ExcelProperty(index = 8, value = "鏍峰搧鍨嬪彿") + @ApiModelProperty("鏍峰搧鍨嬪彿") + private String sampleModel; + + @ApiModelProperty("鏍峰搧缂栧彿") + private String sampleCode; + + // 杩涘巶 + @ApiModelProperty("杩涘巶璁㈠崟id") + private Integer enterOrderId; + + @ApiModelProperty("鎶ュ憡id") + private String enterReportId; + + @ApiModelProperty("绯荤粺鐢熸垚鎶ュ憡鍦板潃") + private String enterUrl; + + @ApiModelProperty("鎵嬪姩涓婁紶鎶ュ憡鍦板潃") + private String enterUrlS; + + // 瀛e害 + @ApiModelProperty("瀛e害璁㈠崟id") + private Integer quarterOrderId; + + @ApiModelProperty("鎶ュ憡id") + private String quarterReportId; + + @ApiModelProperty("绯荤粺鐢熸垚鎶ュ憡鍦板潃") + private String quarterUrl; + + @ApiModelProperty("鎵嬪姩涓婁紶鎶ュ憡鍦板潃") + private String quarterUrlS; + + private Integer orderState; + + @ApiModelProperty("涓嬪彂鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime sendTime; + + @ApiModelProperty("濮旀墭浜�") + private String prepareUser; + + @ApiModelProperty("棰滆壊") + private String color; + + @ApiModelProperty("鏍囩鐘舵��") + private String labelStatus; + + @ApiModelProperty("鏍囩鏉″舰鐮�") + private String labelBarCode; + + @ApiModelProperty("鍒涘缓浜�") + private Integer createUser; + + @ExcelProperty(index = 9, value = "妫�楠屼汉") + @ApiModelProperty("妫�楠屼汉") + private String userName; + + @ExcelProperty(index = 10, value = "涓嬪彂鏃堕棿") + private String sendTimeString; + + @ExcelProperty(index = 14, value = "鎺ユ敹鏃堕棿") + private String receiverDateString; + + @ExcelProperty(index = 15, value = "鎶ユ鏃堕棿") + private String declareDateString; + + // 鍚堟牸鐘舵��,: 0 妫�楠屼腑, 1鍚堟牸, 2涓嶅悎鏍�, 3鏈笅鍗�,4璁╂鏀捐 + @ExcelProperty(index = 6, value = "妫�楠岀姸鎬�") + private String inspectStatusString; + + @ApiModelProperty("鎶ユ寮�濮嬫椂闂�") + private String beginDeclareDate; + + @ApiModelProperty("鎶ユ缁撴潫鏃堕棿") + private String endDeclareDate; + + @ApiModelProperty("涓嶅悎鏍兼弿杩�") + @ExcelProperty(index = 16, value = "涓嶅悎鏍兼弿杩�") + private String unqualifiedDesc; + + + @ApiModelProperty("涓嶅悎鏍奸」") + @ExcelProperty(index = 17, value = "涓嶅悎鏍奸」") + private String unqualifiedItem; + + @ApiModelProperty("鍏嶆") + private Integer isExemption; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/InsSampleReceiveDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/InsSampleReceiveDto.java new file mode 100644 index 0000000..fbc2683 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/InsSampleReceiveDto.java @@ -0,0 +1,35 @@ +package com.ruoyi.basic.dto; + +import com.ruoyi.basic.pojo.InsSample1; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author zhuo + * @Date 2024/10/29 + */ +@Data +public class InsSampleReceiveDto extends InsSample1 { + + @ApiModelProperty("闆朵欢鍙�") + private String partNo; + + @ApiModelProperty("鍘熸潗鏂檌d") + private Integer ifsInventoryId; + + @ApiModelProperty("鑺暟") + private String cores; + + @ApiModelProperty("鍨嬪彿鍙傛暟") + private String modelNum; + + @ApiModelProperty("瀵间綋鏉愯川") + private String conductorMaterial; + + @ApiModelProperty("瀵间綋绫诲瀷") + private String conductorType; + + @ApiModelProperty("鏄惁鏄數缂嗛厤缃�") + private String isCableTag; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/LaboratoryDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/LaboratoryDto.java new file mode 100644 index 0000000..e3f000c --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/LaboratoryDto.java @@ -0,0 +1,18 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class LaboratoryDto { + + private String code = "[2]"; + + private String label; + + private String value; + + private List<SampleTypeDto> children; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/ModelDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/ModelDto.java new file mode 100644 index 0000000..5f8321e --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/ModelDto.java @@ -0,0 +1,15 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +@Data +public class ModelDto { + + private String code = "[5]"; + + private String label; + + private String value; + + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java new file mode 100644 index 0000000..684cf46 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java @@ -0,0 +1,25 @@ +package com.ruoyi.basic.dto; + +import com.ruoyi.basic.pojo.StructureTestObject; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author 鎴村崜 + * @Date 2024/2/26 + */ +@Data +public class PageTestObjectDto extends StructureTestObject { + + @ApiModelProperty(value = "浜у搧") + private String product; + + @ApiModelProperty(value = "鍒涘缓浜�") + private String createUserName; + + @ApiModelProperty(value = "鏇存柊浜�") + private String updateUserName; + + @ApiModelProperty(value = "闆朵欢鍙�") + private String partNo; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/ProductDTO1.java b/basic-server/src/main/java/com/ruoyi/basic/dto/ProductDTO1.java new file mode 100644 index 0000000..8ed7631 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/ProductDTO1.java @@ -0,0 +1,16 @@ +package com.ruoyi.basic.dto; + +import com.ruoyi.basic.pojo.Product; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author zhuo + * @Date 2024/8/5 + */ +@Data +public class ProductDTO1 extends Product { + + @ApiModelProperty(value = "闆朵欢鍙�") + private String partNo; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/ProductDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/ProductDto.java new file mode 100644 index 0000000..efd5d2e --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/ProductDto.java @@ -0,0 +1,11 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +@Data +public class ProductDto { + + private Integer id; + + private String name; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/ResetTreeDragDTO.java b/basic-server/src/main/java/com/ruoyi/basic/dto/ResetTreeDragDTO.java new file mode 100644 index 0000000..d875a91 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/ResetTreeDragDTO.java @@ -0,0 +1,26 @@ +package com.ruoyi.basic.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author zhuo + * @Date 2024/8/22 + */ +@Data +public class ResetTreeDragDTO { + @ApiModelProperty(value = "寮�濮嬬储寮�") + private String beginIndex; + + @ApiModelProperty(value = "缁撴潫绱㈠紩") + private String endIndex; + + @ApiModelProperty(value = "鏍囧噯缂栧彿id") + private String methodId; + + @ApiModelProperty(value = "鏁�") + private String tree; + + @ApiModelProperty(value = "妫�楠岄」琛宨d") + private String productionId; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/SampleDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/SampleDto.java new file mode 100644 index 0000000..18fc086 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/SampleDto.java @@ -0,0 +1,23 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class SampleDto { + + private String code = "[4]"; + + private String label; + + private String value; + + private String partNo; + + // 鏍峰搧鑻辨枃 + private String sampleEn; + + private List<ModelDto> children; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/SampleTypeDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/SampleTypeDto.java new file mode 100644 index 0000000..0ae8087 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/SampleTypeDto.java @@ -0,0 +1,29 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class SampleTypeDto { + + private String code = "[3]"; + + // 妫�娴嬪璞d + private Integer sampleTypeId; + + // 妫�娴嬪璞℃帓搴� + private Integer sort; + + private String label; + + private String value; + + private String partNo; + + // 瀵硅薄鑻辨枃 + private String sampleTypeEn; + + private List<SampleDto> children; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/TestItemDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/TestItemDto.java new file mode 100644 index 0000000..4363a1a --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/dto/TestItemDto.java @@ -0,0 +1,16 @@ +package com.ruoyi.basic.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class TestItemDto { + + private Integer id; + + private String name; + + private List<ProductDto> children; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java b/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java new file mode 100644 index 0000000..4fc2fd2 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java @@ -0,0 +1,25 @@ +package com.ruoyi.basic.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class StructureTestObjectData { + @ExcelProperty(value = "鍦烘墍") + private String laboratory; + + @ExcelProperty(value = "妫�娴嬪璞�") + private String specimenName; + + @ExcelProperty(value = "妫�娴嬪璞�(EN)") + private String specimenNameEn; + + @ExcelProperty(value = "瀵硅薄浠e彿") + private String code; + + @ExcelProperty(value = "浜у搧鍚嶇О") + private String name; + + @ExcelProperty(value = "浜у搧鍚嶇О(EN)") + private String nameEn; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectListener.java b/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectListener.java new file mode 100644 index 0000000..04d3c2c --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectListener.java @@ -0,0 +1,38 @@ +package com.ruoyi.basic.excel; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.ruoyi.basic.service.ProductService; + +import java.util.ArrayList; +import java.util.List; + +public class StructureTestObjectListener extends AnalysisEventListener<StructureTestObjectData> { + private static final int BATCH_COUNT = 1000; + List<StructureTestObjectData> list = new ArrayList<>(); + + private ProductService productService; + + public StructureTestObjectListener(ProductService productService) { + this.productService = productService; + } + + @Override + public void invoke(StructureTestObjectData data, AnalysisContext analysisContext) { + list.add(data); + if (list.size() >= BATCH_COUNT) { + save(); + list.clear(); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + save(); + } + + + private void save() { + productService.importPartExcel(list); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/CertificationMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/CertificationMapper.java new file mode 100644 index 0000000..2d50f3d --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/CertificationMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.pojo.Certification; +import org.apache.ibatis.annotations.Param; + +public interface CertificationMapper extends BaseMapper<Certification> { + + //鏌ヨ璧勮川鏄庣粏鍒楄〃 + IPage<Certification> getCertificationDetail(Page page, @Param("ew") QueryWrapper<Certification> ew); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/IfsInventoryQuantityMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/IfsInventoryQuantityMapper.java new file mode 100644 index 0000000..1963bb9 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/IfsInventoryQuantityMapper.java @@ -0,0 +1,42 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.basic.dto.IfsInventoryQuantityDto; +import com.ruoyi.basic.pojo.IfsInventoryQuantity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDateTime; +import java.util.List; + +@Mapper +public interface IfsInventoryQuantityMapper extends BaseMapper<IfsInventoryQuantity> { + + /** + * 鎵撳嵃鏍囩鏌ヨ + * @param ids + * @return + */ + List<IfsInventoryQuantityDto> printLabel(@Param("ids") List<Integer> ids); + + /** + * + * @param ifsInventoryId + * @return + */ + int selectReportCountById(@Param("ifsInventoryId") Integer ifsInventoryId); + + + /** + * 鏌ヨ褰撳墠瀛e害鏄惁鍑虹幇杩囪鏉愭枡 + * @param partDetail 鍨嬪彿 + * @param supplierName 渚涘簲鍟嗗悕绉� + * @param startOfNextQuarter 瀛e害寮�濮嬫椂闂� + * @param endOfQuarter 瀛e害缁撴潫鏃堕棿 + * @return + */ + Integer selectIsFirst(@Param("partDetail") String partDetail, + @Param("supplierName") String supplierName, + @Param("startOfNextQuarter") LocalDateTime startOfNextQuarter, + @Param("endOfQuarter") LocalDateTime endOfQuarter); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/LaboratoryMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/LaboratoryMapper.java new file mode 100644 index 0000000..df6aab9 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/LaboratoryMapper.java @@ -0,0 +1,20 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.pojo.Laboratory; +import org.apache.ibatis.annotations.Param; + +/** + * 瀹為獙瀹ょ鐞�(Laboratory)琛ㄦ暟鎹簱璁块棶灞� + */ +public interface LaboratoryMapper extends BaseMapper<Laboratory> { + + IPage<Laboratory> selectItemParameter(Page page, @Param("ew") QueryWrapper<Laboratory> ew); + + Object obtainItemParameterList(@Param("page") Page page, @Param("ew") QueryWrapper<Laboratory> ew); + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductMapper.java new file mode 100644 index 0000000..8fdbc4a --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.dto.ProductDTO1; +import com.ruoyi.basic.pojo.Product; +import org.apache.ibatis.annotations.Param; + +/** +* @author z1292 +* @description 閽堝琛ㄣ�恜roduct(浜у搧琛�)銆戠殑鏁版嵁搴撴搷浣淢apper +* @createDate 2024-04-26 01:11:02 +* @Entity com.ruoyi.basic.pojo.Product +*/ +public interface ProductMapper extends BaseMapper<Product> { + + IPage<Product> selectProductListByObjectId(Page page, @Param("ew") QueryWrapper<ProductDTO1> ew, @Param("partNo") String partNo); +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java new file mode 100644 index 0000000..9d2943f --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.ruoyi.basic.pojo.ProductPart; +import org.apache.ibatis.annotations.Param; + +public interface ProductPartMapper extends BaseMapper<ProductPart> { + IPage<ProductPart> selectListByProductId(IPage<ProductPart> page, + @Param("ew") QueryWrapper<ProductPart> ew, + @Param("productId") Integer productId); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductSupplierDensityMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductSupplierDensityMapper.java new file mode 100644 index 0000000..80b387c --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductSupplierDensityMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.pojo.ProductSupplierDensity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 浜у搧鍘傚瀵嗗害缁戝畾琛� + * + * @author zhuo + * @since 2024-09-19 + */ +@Mapper +public interface ProductSupplierDensityMapper extends BaseMapper<ProductSupplierDensity> { + + IPage<ProductSupplierDensity> selectListByProductId(@Param("page") Page page, @Param("ew") QueryWrapper<ProductSupplierDensity> ew, @Param("productId") Integer productId); +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodListMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodListMapper.java new file mode 100644 index 0000000..a5e337b --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodListMapper.java @@ -0,0 +1,40 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.basic.pojo.StandardMethodList; +import com.ruoyi.basic.pojo.StandardProductList; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_method_list(鏍囧噯鏍戜笅鐨勬爣鍑嗗垪琛�)銆戠殑鏁版嵁搴撴搷浣淢apper +* @createDate 2024-03-04 13:44:04 +* @Entity com.ruoyi.basic.pojo.StandardMethodList +*/ +public interface StandardMethodListMapper extends BaseMapper<StandardMethodList> { + + Map<String, String> selectStandardMethodById(Integer id); + + String selectUserById(Integer id); + + List<StandardMethodList> selectStandardMethodLists(String tree); + + List<StandardMethodList> selectStandardMethodListsByNull(String tree); + + List<StandardMethodList> selectStandardMethodLists3(String tree); + + List<StandardMethodList> selectStandardMethodLists2(@Param("data1") String data1, @Param("data2") String data2, @Param("data3") String data3, @Param("data4") String data4, @Param("data5") String data5); + + List<StandardProductList> selectParameterList(String code); + + List<StandardMethodList> selectListEnum(); + + Integer getStandardMethodId(String code); +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodMapper.java new file mode 100644 index 0000000..fb88032 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardMethodMapper.java @@ -0,0 +1,26 @@ +package com.ruoyi.basic.mapper; + +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.framework.mybatis_config.MyBaseMapper; +import com.ruoyi.basic.pojo.StandardMethod; +import org.apache.ibatis.annotations.Param; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_method(鏍囧噯鏂规硶)銆戠殑鏁版嵁搴撴搷浣淢apper +* @createDate 2024-03-03 19:21:41 +* @Entity com.ruoyi.basic.pojo.StandardMethod +*/ +public interface StandardMethodMapper extends MyBaseMapper<StandardMethod> { + + IPage<StandardMethod> selectStandardMethodList(Page page, @Param("ew") QueryWrapper<StandardMethod> ew); + + StandardMethod selectStandMethodById(Integer id); + +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListMapper.java new file mode 100644 index 0000000..f25f673 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.ruoyi.basic.pojo.StandardProductList; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_product_list(鏍囧噯鏍戜笅鐨勬楠岄」鐩�)銆戠殑鏁版嵁搴撴搷浣淢apper +* @createDate 2024-03-05 10:33:29 +* @Entity com.ruoyi.basic.pojo.StandardProductList +*/ +public interface StandardProductListMapper extends BaseMapper<StandardProductList> { + + IPage<StandardProductList> standardProductListIPage(@Param("id") Integer id, @Param("tree") String tree, IPage<StandardProductList> page, @Param("laboratory") String laboratory, @Param("insItem") String insItem, @Param("insItems") String insItems); + + StandardProductList getOne(@Param("standardMethodListId") Integer standardMethodListId, @Param("inspectionItem") String inspectionItem, @Param("sample") String sample, @Param("inspectionItemSubclass") String inspectionItemSubclass, @Param("model") String model, @Param("inspectionItemClass") String inspectionItemClass); + + List<StandardProductList> selectDetail(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("model") String model, @Param("isCableTag") String isCableTag); + + List<StandardProductList> selectDetail2(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("tree") String tree, @Param("isCableTag") String isCableTag); + + /** + * 鏌ヨ闆朵欢棰滆壊 + * @param partNo + * @return + */ + Map<String, String> selectPartColor(@Param("partNo") String partNo); + + /** + * 鍖洪棿淇敼 + * @param productList + * @return + */ + void updateSection(@Param("productList") StandardProductList productList); + + + /** + * 浠庝笂寰�涓嬩慨鏀归『搴� + * @param beginIndex 寮�濮嬩綅缃� + * @param endIndex 缁撴潫浣嶇疆 + * @param methodId 鏍囧噯id + * @param tree 鏍� + */ + void updateSortUp(@Param("beginIndex") Integer beginIndex, + @Param("endIndex") Integer endIndex, + @Param("methodId") Integer methodId, + @Param("tree") String tree); + + /** + * 浠庝笅缃戜笂淇敼椤哄簭 + * @param beginIndex + * @param endIndex + * @param methodId + * @param tree + */ + void updateSortDown(@Param("beginIndex") Integer beginIndex, + @Param("endIndex") Integer endIndex, + @Param("methodId") Integer methodId, + @Param("tree") String tree); +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListSupplierAskMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListSupplierAskMapper.java new file mode 100644 index 0000000..ff3cdfb --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListSupplierAskMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; +import org.apache.ibatis.annotations.Mapper; + +/** + * 妫�楠岄」鐩巶瀹跺瘑搴︾粦瀹氳〃 + * + * @author zhuo + * @since 2024-09-23 + */ +@Mapper +public interface StandardProductListSupplierAskMapper extends BaseMapper<StandardProductListSupplierAsk> { + + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTemplateMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTemplateMapper.java new file mode 100644 index 0000000..feb76f2 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTemplateMapper.java @@ -0,0 +1,32 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.pojo.StandardTemplate; +import org.apache.ibatis.annotations.Param; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_template(鏍囧噯妯℃澘)銆戠殑鏁版嵁搴撴搷浣淢apper +* @createDate 2024-03-11 13:47:52 +* @Entity com.ruoyi.basic.pojo.StandardTemplate +*/ +public interface StandardTemplateMapper extends BaseMapper<StandardTemplate> { + + IPage<StandardTemplate> selectStandardTemplatePageList(Page page, @Param("ew") QueryWrapper<StandardTemplate> ew); + + StandardTemplate getStandTempIdByName(String name); + + /** + * 鏌ヨ鍘嬬缉鍚庣殑鏁版嵁 + * @param templateId + * @return + */ + String selectCompressThing(Integer templateId); +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java new file mode 100644 index 0000000..4deb5df --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java @@ -0,0 +1,92 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.dto.*; +import com.ruoyi.basic.pojo.IfsInventoryQuantity; +import com.ruoyi.basic.pojo.StandardMethodList; +import com.ruoyi.basic.pojo.StandardProductList; +import com.ruoyi.basic.pojo.StandardTree; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Administrator + * @description 閽堝琛ㄣ�恠tandard_tree(鏍囧噯鏍�)銆戠殑鏁版嵁搴撴搷浣淢apper + * @createDate 2024-03-01 15:06:44 + * @Entity com.ruoyi.basic.pojo.StandardTree + */ +public interface StandardTreeMapper extends BaseMapper<StandardTree> { + + List<FactoryDto> selectStandardTreeList(); + + List<StandardTree> selectStandardTreeList2(String sampleType); + + StandardProductList selectStandardProductById(Integer id); + + List<StandardProductList> getStandardProductListBySample(String sampleType); + + List<StandardMethodList> getStandardMethodListBySample(String sampleType); + + List<StandardProductList> selectStandardProductListByTree(String tree, String sample, String model, String trees, String laboratory); + + List<StandardProductList> selectStandardProductListByTree2(String tree, String sample, String model, String trees, String laboratory); + + + List<SampleTypeDto> getStandardTree2(); + + List<SampleDto> getStandardTree3(String sampleType); + + + String getLaboratory(String str); + + Integer getStructureItemParameterId(String sampleType, String item, String itemChild, String inspectionItemClass); + + List<ProductDto> selectPList(String name); + + String selSample(String sample); + + List<FactoryDto> selectStandardTreeListByPartNo(@Param("partNo") String partNo); + + IPage<IfsInventoryQuantity> selectIfsPage(IPage<IfsInventoryQuantity> page, + @Param("ew") QueryWrapper<IfsInventoryQuantity> ew); + + IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, + @Param("ew") QueryWrapper<IfsInventoryQuantityDto> ew); + + + IPage<IfsInventoryQuantityCheckDto> selectIfsInventoryQuantity(Page<IfsInventoryQuantityCheckDto> page, @Param("ew")QueryWrapper<IfsInventoryQuantityCheckDto> ew); + + /** + * 鍘熸潗鎶ユ鏌ヨ鍏ㄩ儴(鍒嗛〉) + * @param page + * @param ew + * @return + */ + IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, @Param("ew") QueryWrapper<IfsInventoryQuantitySupplierDto> ew, @Param("beginDeclareDate") String beginDeclareDate, @Param("endDeclareDate")String endDeclareDate); + + /** + * 鍘熸潗鎶ユ鏌ヨ鍏ㄩ儴(鏃犲垎椤�) + * @param ew + * @return + */ + List<IfsInventoryQuantitySupplierDto> getIfsByOverList(@Param("ew") QueryWrapper<IfsInventoryQuantitySupplierDto> ew, @Param("beginDeclareDate") String beginDeclareDate, @Param("endDeclareDate")String endDeclareDate); + + /** + * 鍘熸潗鏂欐煡璇㈠搴︽楠� + * @param page + * @param + * @param beginDeclareDate + * @param endDeclareDate + * @return + */ + IPage<IfsInventoryQuantitySupplierDto> getIfsByQuarter(Page<IfsInventoryQuantitySupplierDto> page, @Param("ew") QueryWrapper<IfsInventoryQuantitySupplierDto> ew, @Param("beginDeclareDate") String beginDeclareDate, @Param("endDeclareDate")String endDeclareDate); + +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureItemParameterMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureItemParameterMapper.java new file mode 100644 index 0000000..654741a --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureItemParameterMapper.java @@ -0,0 +1,30 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.dto.TestItemDto; +import com.ruoyi.basic.pojo.StructureItemParameter; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 妫�楠岄」鐩弬鏁�(StructureItemParameter)琛ㄦ暟鎹簱璁块棶灞� + * + * @author makejava + * @since 2024-02-26 16:21:17 + */ +public interface StructureItemParameterMapper extends BaseMapper<StructureItemParameter> { + + IPage<StructureItemParameter> selectItemParameterList(Page page, @Param("ew") QueryWrapper<StructureItemParameter> ew); + + List<Map<String, Object>> getInsProduction(); + + List<TestItemDto> getItemTree(); + + int removeNoSample(@Param("sample") String sample); +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java new file mode 100644 index 0000000..1ada57c --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.dto.PageTestObjectDto; +import com.ruoyi.basic.pojo.StructureTestObject; +import org.apache.ibatis.annotations.Param; + +/** + * 妫�娴嬪璞�(StructureTestObject)琛ㄦ暟鎹簱璁块棶灞� + * + * @author makejava + * @since 2024-02-26 17:36:41 + */ +public interface StructureTestObjectMapper extends BaseMapper<StructureTestObject> { + + IPage<PageTestObjectDto> selectTestObjectList(Page page, @Param("ew") QueryWrapper<PageTestObjectDto> ew, @Param("partNo") String partNo); + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectPartMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectPartMapper.java new file mode 100644 index 0000000..33e54f7 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectPartMapper.java @@ -0,0 +1,21 @@ +package com.ruoyi.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.basic.pojo.StructureTestObjectPart; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 妫�楠屽璞¢浂浠惰〃 + * + * @author zhuo + * @since 2024-08-07 + */ +@Mapper +public interface StructureTestObjectPartMapper extends BaseMapper<StructureTestObjectPart> { + IPage<StructureTestObjectPart> selectListByTestObjectId(Page page, @Param("ew") QueryWrapper<StructureTestObjectPart> structureTestObjectPartQueryWrapper, @Param("testObjectId") Integer testObjectId); +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/Certification.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/Certification.java new file mode 100644 index 0000000..7eb1649 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/Certification.java @@ -0,0 +1,72 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@TableName(value = "certification") +@Data +public class Certification implements Serializable { + + @ApiModelProperty(value = "涓婚敭") + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "璧勮川鍚嶇О") + private String name; + + @ApiModelProperty(value = "璧勮川缂栫爜") + private String code; + + @ApiModelProperty(value = "棰佸彂鏈烘瀯") + private String organization; + + @ApiModelProperty(value = "璧勮川璇存槑") + private String explanation; + + @ApiModelProperty(value = "棣栨棰佸彂鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime firstIssuanceDate; + + @ApiModelProperty(value = "鏈�杩戦鍙戞椂闂�") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime latestIssuanceDate; + + + + @ApiModelProperty(value = "鍒版湡棰佸彂鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime expireTime; + + + @ApiModelProperty(value = "棰佸竷鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime dateOfIssuance; + + @ApiModelProperty(value = "鍒涘缓浜�") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + + @ApiModelProperty(value = "鏇存柊浜�") + private String createUserName; + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "璧勮川鍥剧墖鍦板潃") + private String imageUrl; + + @ApiModelProperty(value = "璧勮川闄勪欢鍦板潃") + private String fileUrl; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java new file mode 100644 index 0000000..3984802 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java @@ -0,0 +1,210 @@ +package com.ruoyi.basic.pojo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@TableName("ifs_inventory_quantity") +@ExcelIgnoreUnannotated +public class IfsInventoryQuantity implements Serializable { + @TableId(type = IdType.AUTO) + private Integer id; + + + @ApiModelProperty("鍩�") + private String contract; + + @ExcelProperty(index = 13, value = "璁㈠崟鍙�") + @ApiModelProperty("璁㈠崟鍙�") + private String orderNo; + + @ApiModelProperty("琛屽彿") + private String lineNo; + + @ApiModelProperty("涓嬭揪鍙�") + private String releaseNo; + + @ApiModelProperty("鎺ユ敹鍙�") + private Integer receiptNo; + + @ExcelProperty(index = 3, value = "闆朵欢鍙�") + @ApiModelProperty("闆朵欢鍙�") + private String partNo; + + @ExcelProperty(index = 4, value = "闆朵欢鎻忚堪") + @ApiModelProperty("闆朵欢鎻忚堪") + private String partDesc; + + @ApiModelProperty("鐘舵�佹弿杩�(IFS鍘熸湰鎷夊彇鐨勭姸鎬�)") + private String status; + + @ApiModelProperty("鐘舵��(IFS鍘熸湰鎷夊彇鐨勭姸鎬�)") + private String statusDb; + + @ExcelProperty(index = 11, value = "鎶佃揪鐨勯噰璐暟閲�") + @ApiModelProperty("鎶佃揪鐨勯噰璐暟閲�") + private BigDecimal qtyArrived; + + @ApiModelProperty("宸叉楠岀殑璐拱鏁伴噺") + private BigDecimal qtyInspected; + + @ApiModelProperty("瑕佹楠岀殑閲囪喘鏁伴噺") + private BigDecimal qtyToInspect; + + @ApiModelProperty("渚涘簲鍟嗙紪鍙�") + private String supplierId; + + @ExcelProperty(index = 5, value = "渚涘簲鍟嗗悕绉�") + @ApiModelProperty("渚涘簲鍟嗗悕绉�") + private String supplierName; + + @ApiModelProperty("鎶佃揪鐨勫簱瀛樻暟閲�") + private BigDecimal invQtyInStore; + + @ApiModelProperty("鎶佃揪鐨勯噰璐暟閲�") + private BigDecimal purQtyInStore; + + @ApiModelProperty("閰嶇疆鏍囪瘑") + private String configurationId; + + @ApiModelProperty("鎵瑰彿") + private String lotBatchNo; + + @ApiModelProperty("wdr鍙�") + private String waivDevRejNo; + + @ApiModelProperty("娲诲姩搴忓垪") + private Integer activitySeq; + + @ApiModelProperty("搴忓垪鍙�") + private String serialNo; + + @ApiModelProperty("搴撲綅鍙�") + private String locationNo; + + @ApiModelProperty("鐗堟湰鍙�") + private String engChgLevel; + + @ApiModelProperty("鎺ユ敹浜�") + private String receiver; + + @ApiModelProperty("鎺ユ敹浜哄鍚�") + private String receiverName; + + @ApiModelProperty("閲囪喘鍛�") + private String buyerCode; + + @ApiModelProperty("閲囪喘鍛樺鍚�") + private String buyerName; + + @ApiModelProperty("瀹為檯鍒拌揣鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime arriveDate; + + @ApiModelProperty("瀹為檯浜よ揣鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime deliveryDate; + + @ApiModelProperty("鐢熶骇鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime productDate; + + @ApiModelProperty("澶辨晥鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime invalidDate; + + + @ApiModelProperty("瀹℃壒鏃ユ湡") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvedDate; + + @ApiModelProperty("閲囪喘鐢宠鍒涘缓浜�") + private String reqCeater; + + @ApiModelProperty("閲囪喘鐢宠鍒涘缓浜哄鍚�") + private String reqCeaterName; + + @ApiModelProperty("閲囪喘璁㈠崟琛屽娉�") + private String lineRemarks; + + @ExcelProperty(index = 12, value = "鍗曚綅") + @ApiModelProperty("鍗曚綅") + private String buyUnitMeas; + + @ApiModelProperty("鏄惁涓篿fs鎷夊彇,0 鍚�, 1鏄�") + private Integer isSource; + + private Integer number; + + + @ApiModelProperty("鐘舵��: 0:寰呮姤妫�, 1:寰呮楠�, :宸插鏍�") + private Integer state; + + @ApiModelProperty("鎺ユ敹鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime receiverDate; + + @ApiModelProperty("鏄惁涓洪娆″嚭鐜� 0 鍚� 1 鏄�") + private Integer isFirst; + + @ApiModelProperty("鐩爣搴撲綅鍙�") + private String toLocation; + + @ApiModelProperty("鏄惁鏄姤妫� 0 鍚� 1 鏄�") + private Integer isInspect; + + @ApiModelProperty("鎶ユ浜�") + private String declareUser; + + + @ApiModelProperty("鎶ユ浜篿d") + private Integer declareUserId; + + @ApiModelProperty("鍗曚綅") + private String partUnit; + + @ApiModelProperty("浜т笟閾炬娴嬫暟鎹�") + private String industryChain; + + @ApiModelProperty("鎶ユ鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime declareDate; + + @ApiModelProperty("鏄惁鍗″彲浠ュ搴︽楠� 0 鍚� 1 鏄�") + private Integer isQuarter; + + // 淇敼鍚庣殑 + @ExcelProperty(index = 1, value = "鎵瑰彿") + @ApiModelProperty("鎵瑰彿") + private String updateBatchNo; + + @ApiModelProperty("鏄惁缁撴潫, 0鍚�, 1鏄�") + private Integer isFinish; + + @ApiModelProperty("鏄惁鏄摐鍗曚笣, 0鍚�, 1鏄�") + private Integer isCopper; + + // 鍚堟牸鐘舵��,: 0 妫�楠屼腑, 1鍚堟牸, 2涓嶅悎鏍�, 3鏈笅鍗�,4璁╂鏀捐 + @ApiModelProperty("妫�楠岀姸鎬�") + private Integer inspectStatus; + + @ApiModelProperty("鏄惁閲囪喘璁㈠崟鐧昏: 0鍚�, 1:鏄�") + private Integer isRegister; + + @ApiModelProperty("鏄惁淇敼杩囨壒鍙�: 0鍚�, 1:鏄�") + private Integer isUpdateBatch; + + // 鏄惁鏄繃鏈熸潗鏂�: 0鍚�, 1:鏄�" + @ApiModelProperty("鐗╂枡绫诲瀷") + private Integer isExpire; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/InsSample1.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/InsSample1.java new file mode 100644 index 0000000..19d5cb9 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/InsSample1.java @@ -0,0 +1,123 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 妫�楠屾牱鍝� + * @TableName ins_sample + */ +@TableName(value ="ins_sample") +@Data +public class InsSample1 implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 1锛氬悎鏍� 0锛氫笉鍚堟牸 + */ + private Integer insResult; + + /** + * 澶栭敭锛歩ns_order琛╥d + */ + private Integer insOrderId; + + /** + * 閰嶅鏍峰搧鍨嬪彿 + */ + private String joinModel; + + /** + * 閰嶅鏍峰搧鍚嶇О + */ + private String joinName; + + /** + * 閰嶅鏍峰搧鏁伴噺 + */ + private Integer joinNum; + + /** + * 鏍峰搧缂栫爜 + */ + private String sampleCode; + + /** + * 妫�楠屽伐鍘� + */ + private String factory; + + /** + * 瀹為獙瀹ゅ悕绉� + */ + private String laboratory; + + /** + * 鏍峰搧绫诲瀷 + */ + private String sampleType; + + /** + * 鏍峰搧鍚嶇О + */ + private String sample; + + /** + * 瑙勬牸鍨嬪彿 + */ + private String model; + + /** + * 妫�楠岀姸鎬�(0锛氬緟妫�楠�1:妫�楠屼腑 2:宸叉楠�3锛氬緟澶嶆牳4锛氬鏍告湭閫氳繃5锛氬鏍搁�氳繃) + */ + private Integer insState; + + /** + * 澶囨敞 + */ + private String remark; + + private Integer standardMethodListId; + + @ApiModelProperty("鏍峰搧鍗曚綅") + private String unit; + + private Integer cellId; + + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty("鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty("淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + private Integer parentId; + + @ApiModelProperty("鏁伴噺") + private Integer quantity; + + @ApiModelProperty("鐗规畩鏍囧噯鏂规硶") + private String specialStandardMethod; + + @TableField(select = false,exist = false) + private Integer num=1; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/Laboratory.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/Laboratory.java new file mode 100644 index 0000000..a9343a1 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/Laboratory.java @@ -0,0 +1,62 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 瀹為獙瀹ょ鐞�(Laboratory)琛ㄥ璞� + */ +@TableName(value = "laboratory") +@Data +@NoArgsConstructor +public class Laboratory implements Serializable { + @ApiModelProperty(value = "涓婚敭") + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "瀹為獙瀹ゅ悕绉�") + private String laboratoryName; + + @ApiModelProperty(value = "鍦烘墍缂栫爜") + private String laboratoryNumber; + + @ApiModelProperty(value = "瀹為獙瀹や唬鍙�") + private String laboratoryCode; + + @ApiModelProperty(value = "璐熻矗浜虹數璇�") + private String phoneNumber; + + @ApiModelProperty(value = "璐熻矗浜�") + @TableField(fill = FieldFill.INSERT) + private String head; + + @ApiModelProperty(value = "鍦板潃") + private String address; + + @ApiModelProperty(value = "鍒涘缓浜�") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty(value = "鍒涘缓浜�") + private String createUserName; + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/Product.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/Product.java new file mode 100644 index 0000000..0847231 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/Product.java @@ -0,0 +1,57 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 浜у搧琛� + * @TableName product + */ +@TableName(value ="product") +@Data +public class Product implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 浜у搧鍚嶇О + */ + private String name; + + /** + * 浜у搧鍚嶇ОEN + */ + private String nameEn; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + /** + * 澶栭敭锛歴tructure_test_object琛╥d + */ + private Integer objectId; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java new file mode 100644 index 0000000..0a29975 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java @@ -0,0 +1,49 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +@TableName("product_part") +public class ProductPart implements Serializable { + + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty("浜у搧id") + private Integer productId; + + @ApiModelProperty("闆朵欢鍙�") + private String partNo; + + @ApiModelProperty("棰滆壊") + private String color; + + @ApiModelProperty("鑹叉爣") + private String colorCode; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductSupplierDensity.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductSupplierDensity.java new file mode 100644 index 0000000..b953919 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductSupplierDensity.java @@ -0,0 +1,57 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 浜у搧鍘傚瀵嗗害缁戝畾琛� + * + * @author zhuo + * @since 2024-09-19 + */ +@Data +@TableName("product_supplier_density") +public class ProductSupplierDensity implements Serializable { + + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty("浜у搧id") + private Integer productId; + + @ApiModelProperty("鍨嬪彿") + private String model; + + @ApiModelProperty("鍘傚鍚嶇О") + private String supplierName; + + @ApiModelProperty("瀵嗗害鍊�") + private String densityValue; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethod.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethod.java new file mode 100644 index 0000000..6d5ec08 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethod.java @@ -0,0 +1,85 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 鏍囧噯鏂规硶 + * @TableName standard_method + */ +@TableName(value ="standard_method") +@Data +public class StandardMethod implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + private String field; + + @ApiModelProperty("妫�楠屽璞�") + private String structureTestObjectId; + + /** + * 鏍囧噯缂栧彿 + */ + @ApiModelProperty(value = "鏍囧噯缂栧彿") + private String code; + + /** + * 鏍囧噯鏂规硶 + */ + @ApiModelProperty(value = "鏍囧噯鎻忚堪") + private String name; + + @ApiModelProperty(value = "鏍囧噯鎻忚堪EN") + private String nameEn; + + /** + * 澶囨敞 + */ + @ApiModelProperty(value = "澶囨敞") + private String remark; + + @ApiModelProperty(value = "璧勮川") + private String qualificationId; + + @ApiModelProperty(value = "鏄惁浜у搧鏍囧噯") + private Integer isProduct; + + @ApiModelProperty(value = "鏄惁鍚敤") + private Integer isUse; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓浜�") + @TableField(exist = false,select = false) + private String createUserName; + + @ApiModelProperty(value = "鏇存柊浜�") + @TableField(exist = false,select = false) + private String updateUserName; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethodList.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethodList.java new file mode 100644 index 0000000..8161270 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardMethodList.java @@ -0,0 +1,83 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 鏍囧噯鏍戜笅鐨勬爣鍑嗗垪琛� + * @TableName standard_method_list + */ +@TableName(value ="standard_method_list") +@Data +public class StandardMethodList implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 鏍囧噯缂栧彿 + */ + @ApiModelProperty("鏍囧噯缂栧彿") + private String code; + + /** + * 鏍囧噯鍚嶇О + */ + @ApiModelProperty("鏍囧噯绉板彿") + private String name; + + /** + * 澶囨敞 + */ + @ApiModelProperty("澶囨敞") + private String remark; + + @ApiModelProperty("宸ュ巶") + private String factory; + + @ApiModelProperty("瀹為獙瀹�") + private String laboratory; + + @ApiModelProperty("鏍峰搧鍒嗙被") + private String sampleType; + + @ApiModelProperty("鏍峰搧") + private String sample; + + @ApiModelProperty("鍨嬪彿") + private String model; + + @ApiModelProperty("") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @TableField(exist = false) + private String createUserName; + /** + * + */ + @ApiModelProperty("鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + /** + * + */ + @ApiModelProperty("") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + /** + * + */ + @ApiModelProperty("淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductList.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductList.java new file mode 100644 index 0000000..1c1b79f --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductList.java @@ -0,0 +1,221 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 鏍囧噯鏍戜笅鐨勬楠岄」鐩� + * @TableName standard_product_list + */ +@TableName(value ="standard_product_list") +@Data +public class StandardProductList implements Serializable { + /** + * 涓婚敭id + */ + @TableId(value = "id",type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** + * 妫�楠岄」 + */ + @ApiModelProperty("妫�楠岄」") + private String inspectionItem; + + @ApiModelProperty("妫�楠岄」EN") + private String inspectionItemEn; + + /** + * 妫�楠岄」灏忕被 + */ + @ApiModelProperty("妫�楠岄」灏忕被") + private String inspectionItemSubclass; + + @ApiModelProperty("妫�楠岄」灏忕被EN") + private String inspectionItemSubclassEn; + + /** + * 瀹為獙瀹� + */ + @ApiModelProperty("瀹為獙瀹�") + private String laboratory; + + @ApiModelProperty("瀛愬疄楠屽") + private String sonLaboratory; + + /** + * 璁¢噺鍗曚綅 + */ + @ApiModelProperty("璁¢噺鍗曚綅") + private String unit; + + /** + * 鍗曚环(鍏�) + */ + @ApiModelProperty("鍗曚环") + private String price; + + /** + * 宸ユ椂(H) + */ + @ApiModelProperty("宸ユ椂") + private String manHour; + + /** + * 宸ユ椂鍒嗙粍 + */ + @ApiModelProperty("宸ユ椂鍒嗙粍") + private String manHourGroup; + + /** + * 妫�楠岄」绫诲瀷 + */ + @ApiModelProperty("妫�楠岄」绫诲瀷") + private String inspectionItemType; + + /** + * 妫�楠屽�肩被鍨� + */ + @ApiModelProperty("妫�楠屽�肩被鍨�") + private String inspectionValueType; + + /** + * 妫�楠屾鏁� + */ + @ApiModelProperty("妫�楠屾鏁�") + private Integer checkoutNumber; + + /** + * 鍖洪棿 + */ + @ApiModelProperty("鍖洪棿") + private String section; + + /** + * 鍖洪棿 + */ + @ApiModelProperty("鑺暟鍖洪棿") + private String cores; + + /** + * 鏂规硶 + */ + @ApiModelProperty("鏂规硶鍒楄〃") + private String method; + + @ApiModelProperty("鏂规硶") + private String methodS; + + /** + * 棰勮鏃堕棿(澶�) + */ + @ApiModelProperty("棰勮鏃堕棿") + private Integer manDay; + + /** + * 鐗规畩鏍囪瘑 + */ + @ApiModelProperty("鐗规畩鏍囪瘑") + private String bsm; + + /** + * 瑕佹眰鍊� + */ + @ApiModelProperty("瑕佹眰鍊�") + private String ask; + + @ApiModelProperty("瑕佹眰鎻忚堪") + private String tell; + + /** + * 澶栭敭锛氭爣鍑嗘柟娉昳d + */ + @ApiModelProperty("鏍囧噯鏂规硶id") + private Integer standardMethodListId; + + @ApiModelProperty("宸ュ巶") + private String factory; + + @ApiModelProperty("鏍峰搧鍒嗙被") + private String sampleType; + + @ApiModelProperty("鏍峰搧") + private String sample; + + @ApiModelProperty("鍨嬪彿") + private String model; + + @ApiModelProperty("鍨嬪彿") + private Integer templateId; + + @ApiModelProperty("") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + /** + * + */ + @ApiModelProperty("鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + /** + * + */ + @ApiModelProperty("") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + /** + * + */ + @ApiModelProperty("淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @ApiModelProperty("1锛氭湁鏁� 0锛氭棤鏁�") + private Integer state; + + private String dic; + + private String tree; + + private Integer structureItemParameterId; + + @ApiModelProperty(value = "妫�楠岄」鍒嗙被") + private String inspectionItemClass; + + @ApiModelProperty(value = "妫�楠岄」鍒嗙被EN") + private String inspectionItemClassEn; + + @ApiModelProperty(value = "鏉′欢") + private String radius; + + @ApiModelProperty(value = "鏉′欢鍒楄〃") + private String radiusList; + + @ApiModelProperty(value = "鏀惰垂鏍囧噯(鍏�/娆�)") + private String rates; + + @ApiModelProperty(value = "绱㈠紩椤哄簭") + private Integer sort; + + /** + * 瀵间綋鏉愯川 + */ + @ApiModelProperty("瀵间綋鏉愯川") + private String conductorMaterial; + + /** + * 瀵间綋绫诲瀷 + */ + @ApiModelProperty("瀵间綋绫诲瀷") + private String conductorType; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductListSupplierAsk.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductListSupplierAsk.java new file mode 100644 index 0000000..c857a6c --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductListSupplierAsk.java @@ -0,0 +1,58 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 妫�楠岄」鐩巶瀹跺瘑搴︾粦瀹氳〃 + * + * @author zhuo + * @since 2024-09-23 + */ +@TableName(value ="standard_product_list_supplier_ask") +@Data +public class StandardProductListSupplierAsk { + + @TableId(type = IdType.AUTO) + private Integer supplierAskId; + + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty("妫�楠岄」鐩甶d") + private Long productListId; + + @ApiModelProperty("鍘傚鍚嶇О") + private String supplierName; + + @ApiModelProperty("瑕佹眰鍊�") + private String ask; + + @ApiModelProperty("瑕佹眰鎻忚堪") + private String tell; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTemplate.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTemplate.java new file mode 100644 index 0000000..e26971f --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTemplate.java @@ -0,0 +1,76 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 鏍囧噯妯℃澘 + * @TableName standard_template + */ +@TableName(value ="standard_template") +@Data +public class StandardTemplate implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 妯℃澘鍚嶇О + */ + @ApiModelProperty("妯℃澘鍚嶇О") + private String name; + + /** + * 澶囨敞 + */ + @ApiModelProperty("澶囨敞") + private String remark; + + /** + * 妯℃澘缁撴瀯 + */ + private String thing; + + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + /** + * + */ + @ApiModelProperty("鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + /** + * + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + /** + * + */ + @ApiModelProperty("淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @ApiModelProperty("鍒涘缓鐢ㄦ埛") + @TableField(exist = false) + private String createUserName; + + @ApiModelProperty("鏇存柊鐢ㄦ埛") + @TableField(exist = false) + private String updateUserName; + + /** + * 妯℃澘缂栧彿 + */ + @ApiModelProperty("妯℃澘缂栧彿") + private String number; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTree.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTree.java new file mode 100644 index 0000000..8c2b6cf --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StandardTree.java @@ -0,0 +1,96 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** +* 鏍囧噯鏍� +* @TableName standard_tree +*/ +@TableName(value ="standard_tree") +@Data +public class StandardTree implements Serializable { + + /** + * + */ + @NotNull(message="[]涓嶈兘涓虹┖") + @ApiModelProperty("") + @TableId(type = IdType.AUTO) + private Integer id; + /** + * 宸ュ巶 + */ + @Size(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + @ApiModelProperty("宸ュ巶") + @Length(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + private String factory; + /** + * 瀹為獙瀹� + */ + @Size(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + @ApiModelProperty("瀹為獙瀹�") + @Length(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + private String laboratory; + /** + * 鏍峰搧澶х被 + */ + @Size(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + @ApiModelProperty("鏍峰搧澶х被") + @Length(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + private String sampleType; + /** + * 鏍峰搧 + */ + @Size(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + @ApiModelProperty("鏍峰搧") + @Length(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + private String sample; + /** + * 鍨嬪彿 + */ + @Size(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + @ApiModelProperty("鍨嬪彿") + @Length(max= 255,message="缂栫爜闀垮害涓嶈兘瓒呰繃255") + private String model; + /** + * + */ + @ApiModelProperty("") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + /** + * + */ + @ApiModelProperty("鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + /** + * + */ + @ApiModelProperty("") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + /** + * + */ + @ApiModelProperty("淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + /** + * 淇敼鍓嶅悕绉� + */ + @TableField(exist = false,select = false) + private String oldModel; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureItemParameter.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureItemParameter.java new file mode 100644 index 0000000..7faa8be --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureItemParameter.java @@ -0,0 +1,121 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 妫�楠岄」鐩弬鏁�(StructureItemParameter)琛ㄥ璞� + * + * @author makejava + * @since 2024-02-26 16:21:17 + */ +@TableName(value ="structure_item_parameter") +@Data +public class StructureItemParameter implements Serializable { + @ApiModelProperty(value = "涓婚敭") + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "妫�楠岄」") + private String inspectionItem; + + @ApiModelProperty(value = "妫�楠岄」EN") + private String inspectionItemEn; + + @ApiModelProperty(value = "妫�楠屽瓙椤�") + private String inspectionItemSubclass; + + @ApiModelProperty(value = "妫�楠屽瓙椤笶N") + private String inspectionItemSubclassEn; + + @ApiModelProperty(value = "妫�楠屽璞�") + private String sample; + + @ApiModelProperty(value = "鍗曚环(鍏�)") + private String price; + + @ApiModelProperty(value = "鍦烘墍") + private String laboratory; + + @ApiModelProperty(value = "璇曢獙瀹�") + private String sonLaboratory; + + @ApiModelProperty(value = "瑕佹眰鎻忚堪") + private String askTell; + + @ApiModelProperty(value = "瑕佹眰鍊�") + private String ask; + + @ApiModelProperty(value = "璁¢噺鍗曚綅") + private String unit; + + @ApiModelProperty(value = "璇曢獙鏂规硶") + private String method; + + @ApiModelProperty(value = "宸ユ椂(H)") + private Double manHour; + + @ApiModelProperty(value = "棰勮鏃堕棿(H)") + private Integer manDay; + + @ApiModelProperty(value = "宸ユ椂鍒嗙粍") + private String manHourGroup; + + @ApiModelProperty(value = "妫�楠岄」绫诲瀷") + private String inspectionItemType; + + @ApiModelProperty(value = "妫�楠屽�肩被鍨�") + private String inspectionValueType; + + @ApiModelProperty(value = "妫�楠屾鏁�") + private Integer checkoutNumber; + + @ApiModelProperty(value = "鍖洪棿") + private String section; + + @ApiModelProperty(value = "鐗规畩鏍囪瘑") + private String bsm; + + @ApiModelProperty(value = "鍘熷璁板綍妯℃澘") + private Integer templateId; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "瀛楀吀绫诲瀷") + private String dic; + + @ApiModelProperty(value = "妫�楠岄」鍒嗙被") + private String inspectionItemClass; + + @ApiModelProperty(value = "妫�楠岄」鍒嗙被EN") + private String inspectionItemClassEn; + + @ApiModelProperty(value = "鏉′欢") + private String radiusList; + + @ApiModelProperty(value = "鏀惰垂鏍囧噯(鍏�/娆�)") + private String rates; + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java new file mode 100644 index 0000000..d5af3f2 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java @@ -0,0 +1,63 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 妫�娴嬪璞�(StructureTestObject)琛ㄥ璞� + * + * @author makejava + * @since 2024-02-26 17:36:41 + */ +@TableName(value ="structure_test_object") +@Data +public class StructureTestObject implements Serializable { + @ApiModelProperty(value = "涓婚敭") + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "鍦烘墍") + private Integer laboratoryId; + + @ApiModelProperty(value = "妫�楠屽璞�") + private String specimenName; + + @ApiModelProperty(value = "妫�楠屽璞N") + private String specimenNameEn; + + @ApiModelProperty(value = "瀵硅薄浠e彿") + private String code; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "鎺掑簭") + private Integer sort; + + //"瀵硅薄绫诲瀷, 1:鍘熸潗鏂�, 2:鎴愬搧, 3:杈呮潗" + @ApiModelProperty(value = "瀵硅薄绫诲瀷") + private String objectType; + + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java new file mode 100644 index 0000000..a1e500c --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java @@ -0,0 +1,56 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 妫�楠屽璞¢浂浠惰〃(StructureTestObjectPart)$desc + * + * @author makejava + * @since 2024-08-07 10:10:30 + */ +@TableName(value ="structure_test_object_part") +@Data +public class StructureTestObjectPart implements Serializable { + + @TableId(type = IdType.AUTO) + private Integer id; + + @ApiModelProperty("妫�楠屽璞d") + private Integer testObjectId; + + @ApiModelProperty("闆朵欢鍙�") + private String partNo; + + @ApiModelProperty("棰滆壊") + private String color; + + @ApiModelProperty("鑹叉爣") + private String colorCode; + + @ApiModelProperty(value = "鍒涘缓浜篿d") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + + @ApiModelProperty(value = "淇敼浜篿d") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/CapacityScopeService.java b/basic-server/src/main/java/com/ruoyi/basic/service/CapacityScopeService.java new file mode 100644 index 0000000..6139cd1 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/CapacityScopeService.java @@ -0,0 +1,46 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.dto.PageTestObjectDto; +import com.ruoyi.basic.dto.TestItemDto; + +import com.ruoyi.basic.pojo.StructureItemParameter; +import com.ruoyi.basic.pojo.StructureTestObject; + +import java.util.List; +import java.util.Map; + +/** + * 妫�楠岄」鐩弬鏁�(StructureItemParameter)琛ㄦ湇鍔℃帴鍙� + * + * @author makejava + * @since 2024-02-26 16:21:17 + */ +public interface CapacityScopeService extends IService<StructureItemParameter> { + + IPage<StructureItemParameter> selectItemParameterList(Page page, StructureItemParameter itemParameter); + + int addItemParameter(StructureItemParameter itemParameter); + + int delItemParameter(Integer id); + + int upItemParameter(StructureItemParameter itemParameter); + + IPage<PageTestObjectDto> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto); + + int addTestObject(StructureTestObject testObject); + + int delTestObject(Integer id); + + int upTestObject(StructureTestObject testObject); + + List<StructureTestObject> selectTestObjectByName(); + + //璁惧閲岄潰閫夋嫨妫�楠岄」鐩�(鏍戝舰缁撴瀯) + List<Map<String, Object>> getInsProduction(); + + List<TestItemDto> getItemTree(); +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/CertificationService.java b/basic-server/src/main/java/com/ruoyi/basic/service/CertificationService.java new file mode 100644 index 0000000..7ecac80 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/CertificationService.java @@ -0,0 +1,17 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.Certification; + +public interface CertificationService extends IService<Certification> { + //鏌ヨ璧勮川鏄庣粏鍒楄〃 + IPage<Certification> getCertificationDetail(Page page, Certification certification); + + //娣诲姞璧勮川鏄庣粏鍒楄〃 + int addCertificationDetail(Certification certification); + + //鍒犻櫎璧勮川鏄庣粏鍒楄〃 + int delCertificationDetail(String ids); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/LaboratoryService.java b/basic-server/src/main/java/com/ruoyi/basic/service/LaboratoryService.java new file mode 100644 index 0000000..4dc05a5 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/LaboratoryService.java @@ -0,0 +1,27 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.Laboratory; + +import java.util.List; + +/** + * 瀹為獙瀹ょ鐞�(Laboratory)琛ㄦ湇鍔℃帴鍙� + */ +public interface LaboratoryService extends IService<Laboratory> { + + IPage<Laboratory> selectItemParameter(Page page, Laboratory itemParameter); + + int addParameter(Laboratory itemParameter); + + int delParameter(Integer id); + + int upParameter(Laboratory itemParameter); + + List<Laboratory> obtainItemParameterList(); + + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java b/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java new file mode 100644 index 0000000..3525752 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java @@ -0,0 +1,14 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.ProductPart; + +public interface ProductPartService extends IService<ProductPart> { + + IPage<ProductPart> selectByProductId(IPage<ProductPart> page,ProductPart productPart); + + void addProductPart(ProductPart productPart); + + void updateProductPartById(ProductPart productPart); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java b/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java new file mode 100644 index 0000000..6fdc7c2 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java @@ -0,0 +1,28 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.dto.ProductDTO1; +import com.ruoyi.basic.excel.StructureTestObjectData; +import com.ruoyi.basic.pojo.Product; + +import java.util.List; + +/** +* @author z1292 +* @description 閽堝琛ㄣ�恜roduct(浜у搧琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice +* @createDate 2024-04-26 01:11:02 +*/ +public interface ProductService extends IService<Product> { + + IPage<Product> selectProductListByObjectId(Page page, ProductDTO1 productDto); + + int addProduct(Product product); + + int upProduct(Product product); + + int delProduct(Integer id); + + void importPartExcel(List<StructureTestObjectData> list); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/ProductSupplierDensityService.java b/basic-server/src/main/java/com/ruoyi/basic/service/ProductSupplierDensityService.java new file mode 100644 index 0000000..13be167 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/ProductSupplierDensityService.java @@ -0,0 +1,22 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.ProductSupplierDensity; + +/** + * 浜у搧鍘傚瀵嗗害缁戝畾琛� + * + * @author zhuo + * @since 2024-09-19 + */ +public interface ProductSupplierDensityService extends IService<ProductSupplierDensity> { + + IPage<ProductSupplierDensity> selectByProductId(Page page, ProductSupplierDensity supplierDensity); + + void addProductSupplierDensity(ProductSupplierDensity supplierDensity); + + void updateProductSupplierDensity(ProductSupplierDensity supplierDensity); +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java new file mode 100644 index 0000000..14ee117 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java @@ -0,0 +1,28 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StandardMethodList; + +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_method_list(鏍囧噯鏍戜笅鐨勬爣鍑嗗垪琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice +* @createDate 2024-03-04 13:44:04 +*/ +public interface StandardMethodListService extends IService<StandardMethodList> { + + int addStandardMethodList(Integer standardId, String tree); + + Map<String, List<?>> selectsStandardMethodByFLSSM(String tree); + + Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree); + + int delStandardMethodByFLSSM(Integer id); + + List<StandardMethodList> selectStandardMethodEnum(); + + Integer getStandardMethodId(String code); + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodService.java new file mode 100644 index 0000000..d9b3432 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodService.java @@ -0,0 +1,30 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StandardMethod; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_method(鏍囧噯鏂规硶)銆戠殑鏁版嵁搴撴搷浣淪ervice +* @createDate 2024-03-03 19:21:41 +*/ +public interface StandardMethodService extends IService<StandardMethod> { + + IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod); + + List<StandardMethod> selectStandardMethods(); + + int addStandardMethod(StandardMethod standardMethod); + + int delStandardMethod(Integer id); + + int upStandardMethod(StandardMethod standardMethod); + + void inputExcel(MultipartFile file) throws IOException; +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService.java new file mode 100644 index 0000000..39e0754 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService.java @@ -0,0 +1,67 @@ +package com.ruoyi.basic.service; + +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.dto.CopyStandardProductListDto; +import com.ruoyi.basic.dto.InsSampleReceiveDto; +import com.ruoyi.basic.dto.ResetTreeDragDTO; +import com.ruoyi.basic.pojo.StandardProductList; + +import java.util.List; +import java.util.Map; + +/** + * @author Administrator + * @description 閽堝琛ㄣ�恠tandard_product_list(鏍囧噯鏍戜笅鐨勬楠岄」鐩�)銆戠殑鏁版嵁搴撴搷浣淪ervice + * @createDate 2024-03-05 10:33:29 + */ +public interface StandardProductListService extends IService<StandardProductList> { + + int upStandardProductList(StandardProductList list); + + int delStandardProduct(JSONArray list); + + List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample); + + Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page); + + IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items); + + Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree, String item); + + boolean updateSection(StandardProductList list); + + /** + * 鏍囧噯搴撴嫋鎷� + * @param resetTreeDragDTO + */ + void resetTreeDrag(ResetTreeDragDTO resetTreeDragDTO); + + /** + * 鏍囧噯搴撴嫋鎷� + * @param standardProductLists + */ + void resetTreeDragBatch(List<StandardProductList> standardProductLists); + + /** + * 妫�楠岄」瑕佹眰鍊煎姣� + * @param copyStandardProductListDto + * @return + */ + List<StandardProductList> copyStandardProductList(CopyStandardProductListDto copyStandardProductListDto); + + /** + * 妫�楠岄」瑕佹眰鍊煎姣斾竴涓� + * @param copyStandardProductListDto + * @return + */ + List<StandardProductList> copyStandardProductOne(CopyStandardProductListDto copyStandardProductListDto); + + /** + * 妫�楠岄」澶嶅埗鎺掑簭 + * @param copyStandardProductListDto + * @return + */ + boolean copyStandardProductSort(CopyStandardProductListDto copyStandardProductListDto); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService2.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService2.java new file mode 100644 index 0000000..4f54fe6 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService2.java @@ -0,0 +1,13 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StandardProductList; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_product_list(鏍囧噯鏍戜笅鐨勬楠岄」鐩�)銆戠殑鏁版嵁搴撴搷浣淪ervice +* @createDate 2024-03-05 10:33:29 +*/ +public interface StandardProductListService2 extends IService<StandardProductList> { + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListSupplierAskService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListSupplierAskService.java new file mode 100644 index 0000000..c32d0e4 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListSupplierAskService.java @@ -0,0 +1,23 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; + +import java.util.List; + +/** + * 妫�楠岄」鐩巶瀹跺瘑搴︾粦瀹氳〃 + * + * @author makejava + * @since 2024-09-23 + */ +public interface StandardProductListSupplierAskService extends IService<StandardProductListSupplierAsk> { + + List<StandardProductListSupplierAsk> selectByProductId(StandardProductListSupplierAsk supplierAsk); + + Integer addProductSupplierAsk(StandardProductListSupplierAsk supplierAsk); + + Integer updateProductSupplierAsk(StandardProductListSupplierAsk supplierAsk); + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardTemplateService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardTemplateService.java new file mode 100644 index 0000000..050cce8 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardTemplateService.java @@ -0,0 +1,34 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StandardTemplate; + +import java.util.List; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_template(鏍囧噯妯℃澘)銆戠殑鏁版嵁搴撴搷浣淪ervice +* @createDate 2024-03-11 13:47:52 +*/ +public interface StandardTemplateService extends IService<StandardTemplate> { + + IPage<StandardTemplate> selectStandardTemplatePageList(Page page, StandardTemplate standardTemplate); + + int addStandardTemplate(StandardTemplate standardTemplate); + + int upStandardTemplate(StandardTemplate standardTemplate); + + int delStandardTemplate(Integer id); + + List<StandardTemplate> getStandardTemplate(); + + String getStandTempThingById(Integer templateId); + + String getStandTempNameById(Integer templateId); + + StandardTemplate getStandTempIdByName(String name); + + int copyStandardTemplate(StandardTemplate newTemplate); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java new file mode 100644 index 0000000..39d08e7 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java @@ -0,0 +1,52 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.dto.FactoryDto; +import com.ruoyi.basic.dto.SampleTypeDto; +import com.ruoyi.basic.pojo.StandardTree; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_tree(鏍囧噯鏍�)銆戠殑鏁版嵁搴撴搷浣淪ervice +* @createDate 2024-03-01 15:06:44 +*/ +public interface StandardTreeService extends IService<StandardTree> { + + List<FactoryDto> selectStandardTreeList(); + + + int addStandardTree(StandardTree standardTree); + + int delStandardTree(String tree); + + int addStandardProduct(String ids, String tree); + + List<SampleTypeDto> getStandardTree2(); + + 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 + * @return + */ + boolean updateTreeSort(List<FactoryDto> list); + + int updateStandardTree(StandardTree standardTree); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StructureItemParameterService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StructureItemParameterService.java new file mode 100644 index 0000000..a697619 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StructureItemParameterService.java @@ -0,0 +1,8 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StructureItemParameter; + +public interface StructureItemParameterService extends IService<StructureItemParameter> { + void removeNoSample(String sample); +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java new file mode 100644 index 0000000..de84817 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java @@ -0,0 +1,22 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StructureTestObjectPart; + +/** + * 妫�楠屽璞¢浂浠惰〃 + * + * @author zhuo + * @since 2024-08-07 + */ +public interface StructureTestObjectPartService extends IService<StructureTestObjectPart> { + + IPage<StructureTestObjectPart> selectByTestObjectId(Page page, StructureTestObjectPart structureTestObjectPart); + + void addTestObjectPart(StructureTestObjectPart structureTestObjectPart); + + void updateTestObjectPart(StructureTestObjectPart structureTestObjectPart); +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectService.java new file mode 100644 index 0000000..200a51a --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectService.java @@ -0,0 +1,15 @@ +package com.ruoyi.basic.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basic.pojo.StructureTestObject; + +/** + * 妫�娴嬪璞�(StructureTestObject)$desc + * + * @author makejava + * @since 2024-09-13 09:45:55 + */ +public interface StructureTestObjectService extends IService<StructureTestObject> { + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java new file mode 100644 index 0000000..f63a161 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java @@ -0,0 +1,185 @@ +package com.ruoyi.basic.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +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.common.exception.base.BaseException; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.dto.PageTestObjectDto; +import com.ruoyi.basic.dto.TestItemDto; +import com.ruoyi.basic.mapper.*; +import com.ruoyi.basic.pojo.*; +import com.ruoyi.basic.service.CapacityScopeService; +import com.ruoyi.basic.service.StandardProductListService; +import com.ruoyi.basic.service.StructureItemParameterService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 妫�楠岄」鐩弬鏁�(StructureItemParameter)琛ㄦ湇鍔″疄鐜扮被 + * + * @author makejava + * @since 2024-02-26 16:21:17 + */ +@Service +@AllArgsConstructor +public class CapacityScopeServiceImpl extends ServiceImpl<StructureItemParameterMapper, StructureItemParameter> implements CapacityScopeService { + + private LaboratoryMapper laboratoryMapper; + + private StructureItemParameterMapper structureItemParameterMapper; + + private StructureTestObjectMapper structureTestObjectMapper; + + private ProductMapper productMapper; + + private StructureTestObjectPartMapper structureTestObjectPartMapper; + + private ProductPartMapper productPartMapper; + + private StandardProductListService standardProductListService; + + private StandardTreeMapper standardTreeMapper; + + private StructureItemParameterService structureItemParameterService; + + @Override + public IPage<StructureItemParameter> selectItemParameterList(Page page, StructureItemParameter itemParameter) { + return structureItemParameterMapper.selectItemParameterList(page, QueryWrappers.queryWrappers(itemParameter)); + } + + @Override + public int addItemParameter(StructureItemParameter itemParameter) { + if (itemParameter.getBsm().equals("")||itemParameter.getBsm()==null){ + itemParameter.setBsm("0"); + } + int insert = structureItemParameterMapper.insert(itemParameter); + return insert; + } + + @Override + public int delItemParameter(Integer id) { + return structureItemParameterMapper.deleteById(id); + } + + @Override + public int upItemParameter(StructureItemParameter itemParameter) { + return structureItemParameterMapper.updateById(itemParameter); + } + + @Override + public IPage<PageTestObjectDto> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto) { + String partNo = pageTestObjectDto.getPartNo(); + pageTestObjectDto.setPartNo(null); + return structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto),partNo); + } + + @Override + public int addTestObject(StructureTestObject testObject) { + Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery().eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName())); + if(count.compareTo(0L) > 0){ + throw new BaseException("妫�楠屽璞′笉鑳介噸澶�"); + } + + return structureTestObjectMapper.insert(testObject); + } + + @Override + public int delTestObject(Integer id) { + // 浜у嚭妫�楠屽璞′骇鍝佺淮鎶� + structureTestObjectPartMapper.delete(Wrappers.<StructureTestObjectPart>lambdaQuery() + .eq(StructureTestObjectPart::getTestObjectId, id)); + + // 鍒犻櫎浜у搧缁存姢鐨勯浂浠剁粦瀹� + List<Product> products = productMapper.selectList(Wrappers.<Product>lambdaQuery() + .eq(Product::getObjectId, id)); + List<Integer> productIds = products.stream().map(Product::getId).collect(Collectors.toList()); + productPartMapper.delete(Wrappers.<ProductPart>lambdaQuery() + .in(ProductPart::getProductId, productIds)); + + // 鍒犻櫎浜у搧缁存姢 + productMapper.delete(Wrappers.<Product>lambdaQuery() + .in(Product::getId, productIds)); + + return structureTestObjectMapper.deleteById(id); + } + + @Override + public int upTestObject(StructureTestObject testObject) { + // 鏌ヨ鏃х殑妫�楠屽璞� + StructureTestObject oldTestObject = structureTestObjectMapper.selectById(testObject.getId()); + + if (!oldTestObject.getSpecimenName().equals(testObject.getSpecimenName())) { + // 鏌ヨ鎵�鏈夊璞′竴鏍风殑妫�楠岄」鐩� + List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate() + .eq(StandardProductList::getSampleType, oldTestObject.getSpecimenName())); + if (CollectionUtils.isNotEmpty(standardProductLists)){ + for (StandardProductList standardProductList : standardProductLists) { + // 淇敼鎵�鏈夌殑瀵硅薄鍚嶇О鍜屾暟鍨嬬粨鏋� + standardProductList.setSampleType(testObject.getSpecimenName()); + // 闇�瑕佹埅鍙栫涓夌骇, 閬垮厤涓夊洓绾у悕绉颁竴鏍蜂慨鏀归敊璇� + String[] trees = standardProductList.getTree().split(" - "); + trees[2] = testObject.getSpecimenName(); + List<String> list = CollUtil.newArrayList(trees); + String newName = CollUtil.join(list, " - "); + standardProductList.setTree(newName); + } + standardProductListService.updateBatchById(standardProductLists); + } + // 淇敼妫�楠岄」鐩弬鏁扮殑妫�楠屽璞� + // 鎷兼帴 ["object", 鏌ヨ妫�楠岄」鐩弬鏁颁慨鏀圭粦瀹氱殑妫�楠屽璞� + String format = "[\"{}\","; + String sampleOld = StrUtil.format(format, oldTestObject.getSpecimenName()); + List<StructureItemParameter> itemParameterList = structureItemParameterService.list(Wrappers.<StructureItemParameter>lambdaQuery() + .like(StructureItemParameter::getSample, sampleOld)); + if (CollectionUtils.isNotEmpty(itemParameterList)) { + for (StructureItemParameter structureItemParameter : itemParameterList) { + // 淇敼缁戝畾鐨勬牱鍝佸悕绉� + String sampleNew = StrUtil.format(format, testObject.getSpecimenName()); + String sampleUp = structureItemParameter.getSample().replace(sampleOld, sampleNew); + structureItemParameter.setSample(sampleUp); + } + structureItemParameterService.updateBatchById(itemParameterList); + } + + // 淇敼鏍戠殑鍨嬪彿 + standardTreeMapper.update(null, Wrappers.<StandardTree>lambdaUpdate() + .eq(StandardTree::getSampleType, oldTestObject.getSpecimenName()) + .set(StandardTree::getSampleType, testObject.getSpecimenName())); + } + + Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery() + .eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName()) + .ne(StructureTestObject::getId, testObject.getId())); + if(count.compareTo(0L) > 0){ + throw new BaseException("妫�楠屽璞′笉鑳介噸澶�"); + } + + return structureTestObjectMapper.updateById(testObject); + } + + @Override + public List<StructureTestObject> selectTestObjectByName() { + return structureTestObjectMapper.selectList(Wrappers.<StructureTestObject>lambdaQuery().select(StructureTestObject::getSpecimenName,StructureTestObject::getId)); + } + + //璁惧閲岄潰閫夋嫨妫�楠岄」鐩�(鏍戝舰缁撴瀯) + @Override + public List<Map<String, Object>> getInsProduction() { + return structureItemParameterMapper.getInsProduction(); + } + + @Override + public List<TestItemDto> getItemTree() { + return structureItemParameterMapper.getItemTree(); + } +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/CertificationServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/CertificationServiceImpl.java new file mode 100644 index 0000000..11a6e61 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/CertificationServiceImpl.java @@ -0,0 +1,45 @@ +package com.ruoyi.basic.service.impl; + +import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.CertificationMapper; +import com.ruoyi.basic.pojo.Certification; +import com.ruoyi.basic.service.CertificationService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +@AllArgsConstructor +@Transactional(rollbackFor = Exception.class) +public class CertificationServiceImpl extends ServiceImpl<CertificationMapper, Certification> implements CertificationService { + + + private CertificationMapper certificationMapper; + + + //鏌ヨ璧勮川鏄庣粏鍒楄〃 + @Override + public IPage<Certification> getCertificationDetail(Page page, Certification certification) { + return certificationMapper.getCertificationDetail(page, QueryWrappers.queryWrappers(certification)); + } + + //娣诲姞璧勮川鏄庣粏鍒楄〃 + @Override + public int addCertificationDetail(Certification certification) { + return certificationMapper.insert(certification); + } + + //鍒犻櫎璧勮川鏄庣粏鍒楄〃 + @Override + public int delCertificationDetail(String ids) { + List<Integer> list = JSON.parseArray(ids,Integer.class); + return certificationMapper.deleteBatchIds(list); + } + +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/LaboratoryServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/LaboratoryServiceImpl.java new file mode 100644 index 0000000..a91a3c5 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/LaboratoryServiceImpl.java @@ -0,0 +1,53 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +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.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.LaboratoryMapper; +import com.ruoyi.basic.pojo.Laboratory; +import com.ruoyi.basic.service.LaboratoryService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 瀹為獙瀹ょ鐞�(Laboratory)琛ㄦ湇鍔″疄鐜扮被 + */ +@Service +@AllArgsConstructor +public class LaboratoryServiceImpl extends ServiceImpl<LaboratoryMapper, Laboratory> implements LaboratoryService { + + + private LaboratoryMapper laboratoryMapper; + + @Override + public IPage<Laboratory> selectItemParameter(Page page, Laboratory itemParameter) { + return laboratoryMapper.selectItemParameter(page, QueryWrappers.queryWrappers(itemParameter)); + } + + @Override + public int addParameter(Laboratory itemParameter) { + return laboratoryMapper.insert(itemParameter); + } + + @Override + public int delParameter(Integer id) { + return laboratoryMapper.deleteById(id); + } + + @Override + public int upParameter(Laboratory itemParameter) { + return laboratoryMapper.updateById(itemParameter); + } + + @Override + public List<Laboratory> obtainItemParameterList() { + return laboratoryMapper.selectList(Wrappers.<Laboratory>lambdaQuery().select(Laboratory::getLaboratoryName, Laboratory::getId)); + } + + +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java new file mode 100644 index 0000000..5ecfb88 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java @@ -0,0 +1,68 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +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.common.exception.base.BaseException; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.ProductPartMapper; +import com.ruoyi.basic.mapper.StructureTestObjectPartMapper; +import com.ruoyi.basic.pojo.ProductPart; +import com.ruoyi.basic.pojo.StructureTestObjectPart; +import com.ruoyi.basic.service.ProductPartService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Transactional +@Service +@AllArgsConstructor +public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, ProductPart> implements ProductPartService { + + private ProductPartMapper productPartMapper; + private StructureTestObjectPartMapper structureTestObjectPartMapper; + + + @Override + public IPage<ProductPart> selectByProductId(IPage<ProductPart> page,ProductPart productPart) { + return productPartMapper.selectListByProductId(page, QueryWrappers.queryWrappers(productPart),productPart.getProductId()); + } + + @Override + public void addProductPart(ProductPart productPart) { + if (productPart.getProductId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), null); + productPartMapper.insert(productPart); + } + + @Override + public void updateProductPartById(ProductPart productPart) { + this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), productPart.getId()); + if (productPart.getProductId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + productPartMapper.updateById(productPart); + } + + // 鍒ゆ柇闆朵欢鍙锋槸鍚﹀瓨鍦� + public void isPartNoExist(String partNo,Integer productId, Integer id) { + // 闆朵欢鍙峰敮涓� 浣嗕笉蹇呭~ + if (StringUtils.isNotBlank(partNo)) { + Long count = productPartMapper.selectCount(new LambdaQueryWrapper<ProductPart>() +// .eq(ProductPart::getProductId, productId) + .eq(ProductPart::getPartNo, partNo) + .ne(id != null, ProductPart::getId, id)); + Long selectCount = structureTestObjectPartMapper.selectCount(Wrappers.<StructureTestObjectPart>lambdaQuery() + .eq(StructureTestObjectPart::getPartNo, partNo)); + if (count > 0 || selectCount > 0) { + throw new BaseException("璇ラ浂浠跺彿宸茬粦瀹氳繃妫�楠屽璞�"); + } + } else { + throw new BaseException("璇疯緭鍏ラ浂浠跺彿"); + } + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java new file mode 100644 index 0000000..d1786cb --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java @@ -0,0 +1,188 @@ +package com.ruoyi.basic.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +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.common.exception.base.BaseException; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.dto.ProductDTO1; +import com.ruoyi.basic.excel.StructureTestObjectData; +import com.ruoyi.basic.mapper.ProductMapper; +import com.ruoyi.basic.mapper.ProductPartMapper; +import com.ruoyi.basic.mapper.StandardTreeMapper; +import com.ruoyi.basic.mapper.StructureTestObjectMapper; +import com.ruoyi.basic.pojo.*; +import com.ruoyi.basic.service.LaboratoryService; +import com.ruoyi.basic.service.ProductService; +import com.ruoyi.basic.service.StandardProductListService; +import com.ruoyi.basic.service.StructureItemParameterService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** +* @author z1292 +* @description 閽堝琛ㄣ�恜roduct(浜у搧琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 +* @createDate 2024-04-26 01:11:02 +*/ +@Service +@AllArgsConstructor +public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> + implements ProductService{ + + private ProductMapper productMapper; + + private LaboratoryService laboratoryService; + + private StructureTestObjectMapper structureTestObjectMapper; + + private ProductPartMapper productPartMapper; + + private StandardProductListService standardProductListService; + + private StandardTreeMapper standardTreeMapper; + + private StructureItemParameterService structureItemParameterService; + + @Override + public IPage<Product> selectProductListByObjectId(Page page, ProductDTO1 product) { + String partNo = product.getPartNo(); + product.setPartNo(null); + return productMapper.selectProductListByObjectId(page, QueryWrappers.queryWrappers(product), partNo); + } + + @Override + public int addProduct(Product product) { + + return productMapper.insert(product); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int upProduct(Product product) { + // 鏌ヨ鍘熸湰鐨勫悕绉� + Product oldProduct = productMapper.selectById(product.getId()); + + if (!oldProduct.getName().equals(product.getName())) { + // 淇敼鍚嶇О鍖归厤鐨勬爣鍑嗘爲涓嬬殑妫�楠岄」鐩� + // 鏌ヨ鎵�鏈夊璞�+鍚嶇О鐨勬爲 + StructureTestObject testObject = structureTestObjectMapper.selectById(oldProduct.getObjectId()); + + List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate() + .eq(StandardProductList::getSample, oldProduct.getName()) + .eq(StandardProductList::getSampleType, testObject.getSpecimenName())); + if (CollectionUtils.isNotEmpty(standardProductLists)) { + for (StandardProductList standardProductList : standardProductLists) { + // 淇敼鏍峰搧鍚嶇О + standardProductList.setSample(product.getName()); + // 淇敼鏍戝悕绉� + // 闇�瑕佹埅鍙栫鍥涚骇, 閬垮厤涓夊洓绾у悕绉颁竴鏍蜂慨鏀归敊璇� + String[] trees = standardProductList.getTree().split(" - "); + trees[3] = product.getName(); + List<String> list = CollUtil.newArrayList(trees); + String newName = CollUtil.join(list, " - "); + standardProductList.setTree(newName); + } + standardProductListService.updateBatchById(standardProductLists); + } + + // 淇敼妫�楠岄」鐩弬鏁扮殑妫�楠屽璞� + // 鎷兼帴["object","product"]鏌ヨ妫�楠岄」鐩弬鏁颁慨鏀圭粦瀹氱殑妫�楠屽璞� + String format = "[\"{}\",\"{}\"]"; + String sampleOld = StrUtil.format(format, testObject.getSpecimenName(), oldProduct.getName()); + List<StructureItemParameter> itemParameterList = structureItemParameterService.list(Wrappers.<StructureItemParameter>lambdaQuery() + .like(StructureItemParameter::getSample, sampleOld)); + if (CollectionUtils.isNotEmpty(itemParameterList)) { + for (StructureItemParameter structureItemParameter : itemParameterList) { + // 淇敼缁戝畾鐨勬牱鍝佸悕绉� + String sampleNew = StrUtil.format(format, testObject.getSpecimenName(), product.getName()); + String sampleUp = structureItemParameter.getSample().replace(sampleOld, sampleNew); + structureItemParameter.setSample(sampleUp); + } + structureItemParameterService.updateBatchById(itemParameterList); + } + + // 淇敼鏍戠殑鍨嬪彿 + standardTreeMapper.update(null, Wrappers.<StandardTree>lambdaUpdate() + .eq(StandardTree::getSampleType, testObject.getSpecimenName()) + .eq(StandardTree::getSample, oldProduct.getName()) + .set(StandardTree::getSample, product.getName())); + } + + return productMapper.updateById(product); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int delProduct(Integer id) { + // 鍒犻櫎闆朵欢缁戝畾 + productPartMapper.delete(Wrappers.<ProductPart>lambdaQuery() + .eq(ProductPart::getProductId, id)); + + return productMapper.deleteById(id); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void importPartExcel(List<StructureTestObjectData> list) { + list.forEach(i -> { + // 妫�楠屽璞� + StructureTestObject structureTestObject1 = structureTestObjectMapper.selectOne(Wrappers.<StructureTestObject>lambdaQuery() + .eq(StructureTestObject::getSpecimenName, i.getSpecimenName()) + .eq(StructureTestObject::getSpecimenNameEn, i.getSpecimenNameEn())); + Laboratory laboratory = laboratoryService.getOne(Wrappers.<Laboratory>lambdaQuery() + .eq(Laboratory::getLaboratoryName, i.getLaboratory())); + if (ObjectUtils.isEmpty(laboratory)) { + throw new BaseException("鏈壘鍒拌鍦烘墍锛�" + i.getLaboratory() + "锛岃妫�鏌ユ槸鍚﹀瓨鍦ㄨ鍦烘墍锛�"); + } + // 濡傛灉涓虹┖杩涜鏂板 + if(ObjectUtils.isEmpty(structureTestObject1)) { + StructureTestObject structureTestObject = new StructureTestObject(); + structureTestObject.setLaboratoryId(laboratory.getId()); + structureTestObject.setSpecimenName(i.getSpecimenName()); + structureTestObject.setSpecimenNameEn(i.getSpecimenNameEn()); + structureTestObject.setCode(i.getCode()); + structureTestObjectMapper.insert(structureTestObject); + + // 浜у搧 + Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery() + .eq(Product::getName, i.getName()) + .eq(Product::getNameEn, i.getNameEn())); + if (ObjectUtils.isEmpty(product)){ + Product product1 = new Product(); + product1.setName(i.getName()); + product1.setNameEn(i.getNameEn()); + product1.setObjectId(structureTestObject.getId()); + baseMapper.insert(product1); + } + } else { + structureTestObject1.setCode(i.getCode()); + structureTestObject1.setLaboratoryId(laboratory.getId()); + structureTestObjectMapper.updateById(structureTestObject1); + // 浜у搧 + Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery() + .eq(Product::getName, i.getName()) + .eq(Product::getNameEn, i.getNameEn())); + if (ObjectUtils.isEmpty(product)){ + Product product1 = new Product(); + product1.setName(i.getName()); + product1.setNameEn(i.getNameEn()); + product1.setObjectId(structureTestObject1.getId()); + baseMapper.insert(product1); + } else { + product.setName(i.getName()); + product.setNameEn(i.getNameEn()); + product.setObjectId(structureTestObject1.getId()); + baseMapper.updateById(product); + } + } + }); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductSupplierDensityServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductSupplierDensityServiceImpl.java new file mode 100644 index 0000000..54a92ab --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductSupplierDensityServiceImpl.java @@ -0,0 +1,64 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.ProductSupplierDensityMapper; +import com.ruoyi.basic.pojo.ProductSupplierDensity; +import com.ruoyi.basic.service.ProductSupplierDensityService; +import org.springframework.stereotype.Service; + +/** + * 浜у搧鍘傚瀵嗗害缁戝畾琛� + * + * @author zhuo + * @since 2024-09-19 + */ +@Service +public class ProductSupplierDensityServiceImpl extends ServiceImpl<ProductSupplierDensityMapper, ProductSupplierDensity> implements ProductSupplierDensityService { + + @Override + public IPage<ProductSupplierDensity> selectByProductId(Page page, ProductSupplierDensity supplierDensity) { + if (supplierDensity.getProductId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + return baseMapper.selectListByProductId(page, QueryWrappers.queryWrappers(supplierDensity), supplierDensity.getProductId()); + } + + @Override + public void addProductSupplierDensity(ProductSupplierDensity supplierDensity) { + if (supplierDensity.getProductId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + // 鏌ヨ鏀瑰巶瀹舵槸鍚︾粦瀹氳繃 +// Long count = baseMapper.selectCount(Wrappers.<ProductSupplierDensity>lambdaQuery() +// .eq(ProductSupplierDensity::getProductId, supplierDensity.getProductId()) +// .eq(ProductSupplierDensity::getModel, supplierDensity) +// .eq(ProductSupplierDensity::getSupplierName, supplierDensity.getSupplierName())); +// if (count > 0){ +// throw new BaseException("璇ヤ骇鍝佸凡缁戝畾杩囪鍘傚"); +// } + + baseMapper.insert(supplierDensity); + } + + @Override + public void updateProductSupplierDensity(ProductSupplierDensity supplierDensity) { + if (supplierDensity.getProductId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + // 鏌ヨ鏀瑰巶瀹舵槸鍚︾粦瀹氳繃 +// Long count = baseMapper.selectCount(Wrappers.<ProductSupplierDensity>lambdaQuery() +// .ne(ProductSupplierDensity::getId, supplierDensity.getId()) +// .eq(ProductSupplierDensity::getProductId, supplierDensity.getProductId()) +// .eq(ProductSupplierDensity::getModel, supplierDensity) +// .eq(ProductSupplierDensity::getSupplierName, supplierDensity.getSupplierName())); +// if (count > 0){ +// throw new BaseException("璇ヤ骇鍝佸凡缁戝畾杩囪鍘傚"); +// } + baseMapper.updateById(supplierDensity); + } +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java new file mode 100644 index 0000000..5ab1ed5 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java @@ -0,0 +1,150 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.basic.mapper.StandardMethodListMapper; +import com.ruoyi.basic.mapper.StandardProductListMapper; +import com.ruoyi.basic.pojo.StandardMethodList; +import com.ruoyi.basic.pojo.StandardProductList; +import com.ruoyi.basic.service.StandardMethodListService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_method_list(鏍囧噯鏍戜笅鐨勬爣鍑嗗垪琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 +* @createDate 2024-03-04 13:44:04 +*/ +@Service +@AllArgsConstructor +public class StandardMethodListServiceImpl extends ServiceImpl<StandardMethodListMapper, StandardMethodList> + implements StandardMethodListService{ + + private StandardMethodListMapper standardMethodListMapper; + + private StandardProductListMapper standardProductListMapper; + + @Override + public int addStandardMethodList(Integer standardId, String tree) { + String[] trees = tree.split(" - "); + Map<String, String> map = standardMethodListMapper.selectStandardMethodById(standardId); + StandardMethodList list = new StandardMethodList(); + list.setCode(map.get("code")); + list.setName(map.get("name")); + list.setRemark(map.get("remark")); + list.setFactory(trees[0]); + try { + list.setLaboratory(trees[1]); + }catch (Exception e){} + try { + list.setSampleType(trees[2]); + }catch (Exception e){} + try { + list.setSample(trees[3]); + }catch (Exception e){} + try { + list.setModel(trees[4]); + }catch (Exception e){} + standardMethodListMapper.insert(list); + List<StandardProductList> standardProductLists = standardMethodListMapper.selectParameterList(list.getCode()); + for (StandardProductList standardProductList : standardProductLists) { + standardProductList.setStandardMethodListId(list.getId()); + standardProductList.setFactory(trees[0]); + try { + standardProductList.setLaboratory(trees[1]); + }catch (Exception e){} + try { + standardProductList.setSampleType(trees[2]); + }catch (Exception e){} + try { + standardProductList.setSample(trees[3]); + }catch (Exception e){} + try { + standardProductList.setModel(trees[4]); + }catch (Exception e){} + standardProductListMapper.insert(standardProductList); + } + return 1; + } + + @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(standardMethodListMapper.selectStandardMethodLists(str)); + standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\"")); + standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); + break; + case 4: + str += "\"" + trees[2] + "\",\"" + trees[3] + "\""; + standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str)); + standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); + break; + case 3: + str += "\"" + trees[2] + "\""; + standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists3(str)); + break; + default: + map.put("standardMethodList", null); + return map; + } + standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodListsByNull(str)); + map.put("standardMethodList", standardMethodLists); + return map; + } + + @Override + public Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree) { + String[] trees = tree.split(" - "); + List<StandardMethodList> standardMethodLists = null; + switch (trees.length){ + case 5: + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],trees[4]); + break; + case 4: + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],null); + break; + case 3: + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],null,null); + break; + case 2: + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],null,null,null); + break; + case 1: + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],null,null,null,null); + break; + } + Map<String, List<?>> map = new HashMap<>(); + map.put("standardMethodList", standardMethodLists); + return map; + } + + @Override + public int delStandardMethodByFLSSM(Integer id) { + standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id)); + return standardMethodListMapper.deleteById(id); + } + @Override + public List<StandardMethodList> selectStandardMethodEnum() { + return standardMethodListMapper.selectListEnum(); + } + + @Override + public Integer getStandardMethodId(String code) { + return baseMapper.getStandardMethodId(code); + } +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodServiceImpl.java new file mode 100644 index 0000000..44566bd --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodServiceImpl.java @@ -0,0 +1,260 @@ +package com.ruoyi.basic.service.impl; + +import cn.hutool.json.JSONUtil; +import cn.hutool.poi.excel.ExcelUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +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.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.StandardMethodMapper; +import com.ruoyi.basic.mapper.StandardProductListMapper; +import com.ruoyi.basic.mapper.StructureItemParameterMapper; +import com.ruoyi.basic.pojo.StandardMethod; +import com.ruoyi.basic.pojo.StandardProductList; +import com.ruoyi.basic.pojo.StructureItemParameter; +import com.ruoyi.basic.service.StandardMethodService; +import com.ruoyi.basic.service.StandardProductListService; +import com.ruoyi.basic.service.StructureItemParameterService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.*; +import java.util.concurrent.CompletableFuture; + +/** + * @author Administrator + * @description 閽堝琛ㄣ�恠tandard_method(鏍囧噯鏂规硶)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 + * @createDate 2024-03-03 19:21:41 + */ +@Service +@AllArgsConstructor +public class StandardMethodServiceImpl extends ServiceImpl<StandardMethodMapper, StandardMethod> + implements StandardMethodService { + + + private StandardMethodMapper standardMethodMapper; + + StandardProductListMapper standardProductListMapper; + StandardProductListService standardProductListService; + + StructureItemParameterMapper structureItemParameterMapper; + StructureItemParameterService structureItemParameterService; + + @Override + public IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod) { + return standardMethodMapper.selectStandardMethodList(page, QueryWrappers.queryWrappers(standardMethod)); + } + + @Override + public List<StandardMethod> selectStandardMethods() { + return standardMethodMapper.selectList(Wrappers.<StandardMethod>lambdaQuery().select(StandardMethod::getId, StandardMethod::getCode, StandardMethod::getName).ne(StandardMethod::getId, 0)); + } + + @Override + public int addStandardMethod(StandardMethod standardMethod) { + int insert = standardMethodMapper.insert(standardMethod); + return insert; + } + + @Override + public int delStandardMethod(Integer id) { + int i = standardMethodMapper.deleteById(id); + return i; + } + + @Override + public int upStandardMethod(StandardMethod standardMethod) { + StandardMethod oldStandardMethod = standardMethodMapper.selectById(standardMethod.getId()); + if (!oldStandardMethod.getCode().equals(standardMethod.getCode())) { + CompletableFuture.supplyAsync(() -> replaceMethod(oldStandardMethod.getCode(), standardMethod.getCode())); + } + int i = standardMethodMapper.updateById(standardMethod); + return i; + } + + //缂栬緫method鍚庡叏閮ㄦ浛鎹� + public String replaceMethod(String oldCode, String code) { + //鏌ヨStandardProductList涓墍鏈塎ethod濡傛灉鍖呭惈涔嬪墠鐨勫垯鏇挎崲 + List<StandardProductList> standardProductLists = standardProductListMapper.selectList(null); + for (StandardProductList standardProductList : standardProductLists) { + if (standardProductList.getMethod().contains(oldCode)) { + String[] split = standardProductList.getMethod().split(","); + String a = null; + for (int i = 0; i < split.length; i++) { + String methodName = split[i].substring(1, split[i].length() - 1); + if (i == 0) { + methodName = split[i].substring(2, split[i].length() - 1); + } else if (i == split.length - 1) { + methodName = split[i].substring(1, split[i].length() - 2); + } + if (methodName.equals(oldCode)) { + methodName = code; + } + a += "\"" + methodName + "\","; + } + String method = "[\"" + a.substring(0, a.length() - 1) + "\"]"; + standardProductList.setMethod(method); + } + } + standardProductListService.updateBatchById(standardProductLists); + //鏌ヨStructureItemParameter涓墍鏈塎ethod濡傛灉鍖呭惈涔嬪墠鐨勫垯鏇挎崲 + List<StructureItemParameter> structureItemParameters = structureItemParameterMapper.selectList(null); + for (StructureItemParameter structureItemParameter : structureItemParameters) { + if (structureItemParameter.getMethod().contains(oldCode)) { + String[] split = structureItemParameter.getMethod().split(","); + String a = null; + for (int i = 0; i < split.length; i++) { + String methodName = split[i].substring(1, split[i].length() - 1); + if (i == 0) { + methodName = split[i].substring(2, split[i].length() - 1); + } else if (i == split.length - 1) { + methodName = split[i].substring(1, split[i].length() - 2); + } + if (methodName.equals(oldCode)) { + methodName = code; + } + a += "\"" + methodName + "\","; + } + String method = "[\"" + a.substring(0, a.length() - 1) + "\"]"; + structureItemParameter.setMethod(method); + } + } + structureItemParameterService.updateBatchById(structureItemParameters); + return "鏇挎崲瀹屾瘯!"; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void inputExcel(MultipartFile file) throws IOException { + // 瀛樺偍妫�娴嬪璞ist + 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) { + StandardMethod standardMethod = new StandardMethod(); + standardMethod.setField(list.get(1).toString()); + // 閫犳牸寮� + List<List<Object>> structureTestObjectId = new ArrayList<>(); + if (ObjectUtils.isEmpty(list.get(3))) { + structureTestObjectId.add(Arrays.asList(list.get(2))); + } else { + structureTestObjectId.add(Arrays.asList(list.get(2), list.get(3))); + } + standardMethod.setStructureTestObjectId(JSONUtil.toJsonStr(structureTestObjectId)); + standardMethod.setCode(list.get(4).toString()); + standardMethod.setName(list.get(5).toString()); + standardMethod.setNameEn(list.get(6).toString()); + if (!Objects.equals(list.get(7), null)) { + standardMethod.setRemark(list.get(7).toString()); + } + standardMethod.setQualificationId(list.get(8).toString()); + if (ObjectUtils.isNotEmpty(list.get(9))) { + if (list.get(9).equals("鏄�")) { + standardMethod.setIsProduct(1); + } else if (list.get(9).equals("鍚�")) { + standardMethod.setIsProduct(0); + } + } + if (ObjectUtils.isNotEmpty(list.get(10))) { + if (list.get(10).equals("鏄�")) { + standardMethod.setIsUse(1); + } else if (list.get(9).equals("鍚�")) { + standardMethod.setIsUse(0); + } + } + 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 -> { + // 浠xcel涓殑缁勫悕鏌ヨ鏁版嵁搴撲腑鐨勫垎缁� + 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())) { + // 缁檈xcel鏁版嵁璧嬪�糹d鍋氭洿鏂� + 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)); + } + } + } + }); + } + if (!addList.isEmpty()) { + // 鏂板 + baseMapper.insertBatchSomeColumn(addList); + } + + if (!deleteListId.isEmpty()) { + // 鍒犻櫎 + baseMapper.deleteBatchIds(deleteListId); + } + + if (!updateList.isEmpty()) { + // 鏇存柊 + updateList.forEach(i -> { + baseMapper.updateById(i); + }); + } + } +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListService2Impl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListService2Impl.java new file mode 100644 index 0000000..eae1bc2 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListService2Impl.java @@ -0,0 +1,12 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.basic.mapper.StandardProductListMapper; +import com.ruoyi.basic.pojo.StandardProductList; +import com.ruoyi.basic.service.StandardProductListService2; +import org.springframework.stereotype.Service; + +@Service +public class StandardProductListService2Impl extends ServiceImpl<StandardProductListMapper, StandardProductList> + implements StandardProductListService2 { +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java new file mode 100644 index 0000000..c5695ec --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java @@ -0,0 +1,701 @@ +package com.ruoyi.basic.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.*; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.basic.dto.CopyStandardProductListDto; +import com.ruoyi.basic.dto.InsSampleReceiveDto; +import com.ruoyi.basic.dto.ProductDto; +import com.ruoyi.basic.dto.ResetTreeDragDTO; +import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; +import com.ruoyi.basic.mapper.StandardProductListMapper; +import com.ruoyi.basic.mapper.StandardProductListSupplierAskMapper; +import com.ruoyi.basic.mapper.StandardTreeMapper; +import com.ruoyi.basic.pojo.StandardProductList; +import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; +import com.ruoyi.basic.pojo.StandardTree; +import com.ruoyi.basic.service.StandardProductListService; +import com.ruoyi.basic.service.StandardProductListService2; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * @author Administrator + * @description 閽堝琛ㄣ�恠tandard_product_list(鏍囧噯鏍戜笅鐨勬楠岄」鐩�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 + * @createDate 2024-03-05 10:33:29 + */ +@Service +@AllArgsConstructor +public class StandardProductListServiceImpl extends ServiceImpl<StandardProductListMapper, StandardProductList> + implements StandardProductListService { + + private StandardProductListMapper standardProductListMapper; + + private StandardTreeMapper standardTreeMapper; + + private StandardProductListService2 standardProductListService2; + + private IfsInventoryQuantityMapper ifsInventoryQuantityMapper; + + private StandardProductListSupplierAskMapper standardProductListSupplierAskMapper; + + + @Override + public int upStandardProductList(StandardProductList list) { + return standardProductListMapper.updateById(list); + } + + @Override + public int delStandardProduct(JSONArray list) { + return standardProductListMapper.deleteBatchIds(list); + } + + @Override + public List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample) { + // 鏄惁娌℃湁浜у搧 + boolean isNoSample = false; +// String[] models = insSample.getModel().split("-(?=[^-]*$)");//鎷嗗垎鏈�鍚庝竴涓��-銆� + String model = insSample.getModel(); + String modelNum = insSample.getModelNum(); + List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, model, insSample.getIsCableTag()); + if (list.size() == 0) { + if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { + return null; + } + String[] split = insSample.getFactory().split(" - "); + split[3] = split[3].replace("- ", ""); + String tree = split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3] + " - null"; + list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree, insSample.getIsCableTag()); + if (list.size() == 0) { + String tree1 = split[0] + " - " + split[1] + " - " + split[2] + " - null - " + split[3]; + list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree1, insSample.getIsCableTag()); + + // 鍙湁瀵硅薄鐨勪竴灞� + if (list.size() == 0) { + String tree2 = split[0] + " - " + split[1] + " - " + split[2] + " - null - null"; + list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree2, insSample.getIsCableTag()); + // 鏍峰搧鐩存帴璧嬪�兼牱鍝佸垎绫� + list.forEach(standardProductList -> standardProductList.setSample(standardProductList.getSampleType())); + isNoSample = true; + } + } + } + String[] split1 = insSample.getFactory().split(" - "); + if (!isNoSample) { + //鍒ゆ柇闀垮害 + if (split1.length > 4) { + if (ObjectUtils.isNotEmpty(split1[3])) { + list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample()) && Objects.equals(list1.getSample(), split1[3])).collect(Collectors.toList()); + } else if (split1[3].equals("")) { + list = list.stream().filter(list1 -> Objects.nonNull(list1.getSampleType()) && Objects.equals(list1.getSampleType(), split1[2])).collect(Collectors.toList()); + } + } + } + list = list.stream().filter(a -> { + try { + if (a.getSection() != null && !Objects.equals(a.getSection(), "")) { + List<String> sections = JSON.parseArray(a.getSection(), String.class);// 鍖洪棿 + List<String> cores = JSON.parseArray(a.getCores(), String.class); // 鑺暟 + List<String> conductorMaterials = JSON.parseArray(a.getConductorMaterial(), String.class); // 瀵间綋鏉愯川 + List<String> conductorTypes = JSON.parseArray(a.getConductorType(), String.class); // 瀵间綋绫诲瀷 + List<String> asks = JSON.parseArray(a.getAsk(), String.class); + List<String> tells = JSON.parseArray(a.getTell(), String.class); + boolean isIf; + for (int i = 0; i < sections.size(); i++) { + if (Objects.equals(a.getBsm(), "1")) { + return true; + } else { + if (sections.get(i).contains("&")) { + String[] split = sections.get(i).split("&"); + isIf = getIsIf(split[0], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample) + && getIsIf(split[1], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample); + } else { + isIf = getIsIf(sections.get(i), modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample); + } + if (isIf) { + a.setSection(sections.get(i)); + a.setAsk(asks.get(i)); + a.setTell(tells.get(i)); + return true; + } + } + } + return false; + } + } catch (Exception ignored) { + return false; + } + return true; + }).peek(standardProductList -> { + // todo: 鍒ゆ柇鏄惁鏄師鏉愪笅鍗�, 闇�瑕佸晩鎶婇鑹茬粦瀹氬埌璇曟牱棰滆壊鐨勮姹傚�间笂 + if (StringUtils.isNotBlank(insSample.getPartNo())) { + // 鍒ゆ柇鏄惁鏈夎繖涓瓧娈典笖鏄枃鏈被鍨� + if (StringUtils.isNotBlank(standardProductList.getInspectionItem()) + && standardProductList.getInspectionItem().contains("璇曟牱棰滆壊")) { + Map<String, String> partColor = baseMapper.selectPartColor(insSample.getPartNo()); + if (CollectionUtils.isNotEmpty(partColor)) { + if (StringUtils.isNotBlank(partColor.get("color"))) { + // 鍒ゆ柇妫�楠屽�兼槸鍚︿负绌哄拰涓嶇瓑浜� - 鍜� / + if (StringUtils.isBlank(standardProductList.getAsk()) || partColor.get("color").contains("鏈�")) { // 娌℃湁ask鐩存帴澶嶅埗 + // 鏌ヨ瀵硅薄缁戝畾琛ㄥ拰浜у搧缁戝畾琛� + standardProductList.setAsk("=" + partColor.get("color") + + (StringUtils.isBlank(partColor.get("color_code")) ? "" : "(" + partColor.get("color_code") + ")")); + standardProductList.setTell(partColor.get("color") + + (StringUtils.isBlank(partColor.get("color_code")) ? "" : "(" + partColor.get("color_code") + ")")); + standardProductList.setInspectionValueType("2"); + } else { // 鎷兼帴鍒拌姹傛弿杩板墠闈� + standardProductList.setTell(partColor.get("color") + + (StringUtils.isBlank(partColor.get("color_code")) ? "" : "(" + partColor.get("color_code") + ")") + "@" + standardProductList.getTell()); + } + } + } + } + } + }) + .collect(Collectors.toList()); + + // 鏌ヨ鍘傚鏄惁鏈夌壒娈婅姹傚�� + if (insSample.getIfsInventoryId() != null) { + // 鏌ヨ鍘熸潗鏂欏巶瀹跺悕绉� + String supplierName = ifsInventoryQuantityMapper.selectById(insSample.getIfsInventoryId()) + .getSupplierName(); + List<Long> collect = list.stream().map(StandardProductList::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)) { + List<StandardProductListSupplierAsk> supplierAsks = standardProductListSupplierAskMapper.selectList(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() + .in(StandardProductListSupplierAsk::getProductListId, collect) + .eq(StandardProductListSupplierAsk::getSupplierName, supplierName)); + + // 鍒ゆ柇鏈夋病鏈夌壒娈婂�肩粦瀹� + if (CollectionUtils.isNotEmpty(supplierAsks)) { + for (StandardProductList standardProductList : list) { + for (StandardProductListSupplierAsk supplierAsk : supplierAsks) { + if (standardProductList.getId().equals(supplierAsk.getProductListId())) { + // 閲嶆柊璧嬪�艰姹傚�煎拰瑕佹眰鎻忚堪 + standardProductList.setAsk(supplierAsk.getAsk()); + standardProductList.setTell(supplierAsk.getTell()); + } + } + } + } + } + } + + return list; + } + + /** + * + * @param str 鍒ゅ畾鍏紡 + * @param model 鍨嬪彿 + * @param standardCores 鑺暟 + * @param conductorMaterial 瀵间綋鏉愯川 + * @param conductorType 瀵间綋绫诲瀷 + * @param insSample + * @return + */ + private boolean getIsIf(String str, String model, String standardCores, String conductorMaterial, String conductorType,InsSampleReceiveDto insSample) { + Matcher matcher = Pattern.compile("\\d+(\\.\\d+)?").matcher(model); + String model2 = ""; + while (matcher.find()) { + model2 += matcher.group(); + break; + } + boolean flag = false; + if (str.contains("鈮�") || str.contains(">=")) { + String param = str.replace("鈮�", "").replace(">=", ""); + flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) > -1; + } else if (str.contains("鈮�") || str.contains("<=")) { + String param = str.replace("鈮�", "").replace("<=", ""); + flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) < 1; + } else if (str.contains(">") || str.contains("锛�")) { + String param = str.replace(">", "").replace("锛�", ""); + flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) > 0; + } else if (str.contains("<") || str.contains("锛�")) { + String param = str.replace("<", "").replace("锛�", ""); + flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) < 0; + } else if (str.contains("=")) { + String param = str.replace("=", ""); + flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) == 0; + } + if (flag) { + boolean coresMatch = true; + boolean conductorMaterialMatch = true; + boolean conductorTypeMatch = true; + + // 鍒ゆ柇鏄惁鏈夌嚎鑺暟閲� + if (StringUtils.isNotBlank(standardCores)) { + if (StringUtils.isBlank(insSample.getCores()) || !standardCores.equals(insSample.getCores())) { + coresMatch = false; + } + } + + // 鍒ゆ柇鏄惁鏈夊浣撴潗璐� + if (StringUtils.isNotBlank(conductorMaterial)) { + if (StringUtils.isBlank(insSample.getConductorMaterial()) || !conductorMaterial.equals(insSample.getConductorMaterial())) { + conductorMaterialMatch = false; + } + } + + // 鍒ゆ柇鏄惁鏈夊浣撶被鍨� + if (StringUtils.isNotBlank(conductorType)) { + if (StringUtils.isBlank(insSample.getConductorType()) || !conductorType.equals(insSample.getConductorType())) { + conductorTypeMatch = false; + } + } + // 鏈�缁堝垽鏂� + flag = coresMatch && conductorMaterialMatch && conductorTypeMatch; + } + + return flag; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page) { + String[] trees = tree.split(" - "); + try { + String tree1 = trees[2]; + } catch (Exception e) { + throw new BaseException("鎿嶄綔澶揩,绯荤粺浼犲弬閿欒!!!!"); + } + boolean isDrag = false; + List<StandardProductList> list = new ArrayList<>(); + if (trees.length == 3) { + List<StandardTree> treeList = new ArrayList<>(); + StandardTree standardTree = new StandardTree(); + standardTree.setFactory(trees[0]); + standardTree.setLaboratory(trees[1]); + standardTree.setSampleType(trees[2]); + List<ProductDto> pList = standardTreeMapper.selectPList(trees[2]); + if (pList.size() == 0 || pList.get(0) == null) { + List<StandardTree> treeList1 = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2])); + if (treeList1.size() == 0) { + treeList.add(standardTree); + } else { + treeList.addAll(treeList1); + } + } else { + for (ProductDto p : pList) { + standardTree.setSample(p.getName()); + List<StandardTree> treeList1 = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, p.getName())); + if (treeList1.size() == 0) { + treeList.add(JSON.parseObject(JSON.toJSONString(standardTree), StandardTree.class)); + } else { + treeList.addAll(treeList1); + } + } + } + for (StandardTree standardTree2 : treeList) { + String tree2 = trees[0] + " - " + trees[1] + " - " + trees[2] + " - " + standardTree2.getSample() + " - " + standardTree2.getModel(); + list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree2.getSample(), standardTree2.getModel(), tree2, trees[1])); + list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + standardTree2.getSample() + "\"", standardTree2.getSample(), standardTree2.getModel(), tree2, trees[1])); + } + } else if (trees.length == 4) { + // 鍒ゆ柇绗洓灞傛槸鍚︽湁鍨嬪彿 + Long count = standardProductListMapper.selectCount(Wrappers.<StandardProductList>lambdaQuery() + .eq(StandardProductList::getStandardMethodListId, id) + .isNull(StandardProductList::getModel) + .like(StandardProductList::getTree, tree)); + if (count == 0) { + isDrag = true; + } + + isDrag = true; + List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3])); + if (treeList.size() == 0) { + StandardTree standardTree = new StandardTree(); + standardTree.setFactory(trees[0]); + standardTree.setLaboratory(trees[1]); + standardTree.setSampleType(trees[2]); + standardTree.setSample(trees[3]); + treeList.add(standardTree); + } + for (StandardTree standardTree : treeList) { + String str = tree + " - " + standardTree.getModel(); + list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str, trees[1])); + list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + trees[3] + "\"", standardTree.getSample(), standardTree.getModel(), str, trees[1])); + } + } else { + isDrag = true; + list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", trees[3].equals("null") ? null : trees[3], trees[4], tree, trees[1])); + list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + trees[3] + "\"", trees[3].equals("null") ? null : trees[3], trees[4], tree, trees[1])); + } + for (StandardProductList productList : list) { + productList.setId(IdWorker.getId()); + } + List<StandardProductList> standardProductLists; + + if (isDrag) { + standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() + .eq(StandardProductList::getStandardMethodListId, id) + .like(StandardProductList::getTree, tree) + .orderByAsc(StandardProductList::getSort)); + // 鍒ゆ柇鏄惁鏈夋病鏈夊簭鍙风殑, 娌℃湁搴忓彿閲嶇疆 + boolean b = standardProductLists.stream().anyMatch(standardProductList -> standardProductList.getSort() == null); + } else { + standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() + .eq(StandardProductList::getStandardMethodListId, id) + .like(StandardProductList::getTree, tree)); + } + + for (StandardProductList sp : standardProductLists) { + for (StandardProductList pl : list) { + // 鍒ゆ柇鏉′欢鏄惁鍙湁涓�涓�, 鏈変竴涓殑璇濋粯璁ょ涓�涓� + String radiusList = pl.getRadiusList(); + if (StringUtils.isNotBlank(radiusList) && !radiusList.equals("null") && !radiusList.equals("\"\"")) { + JSONArray jsonArray = JSON.parseArray(radiusList); + List<String> radius = jsonArray.toJavaList(String.class); + if (CollectionUtils.isNotEmpty(radius) && radius.size() == 1) { + pl.setRadius(radius.get(0)); + } + } + if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem()) + && Objects.equals((sp.getInspectionItemSubclass() == null) ? "" : sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass() == null ? "" : pl.getInspectionItemSubclass()) +// && Objects.equals(sp.getSample(), pl.getSample()) + && Objects.equals(sp.getModel(), pl.getModel()) + && sp.getTree().indexOf(pl.getSample() == null ? "null" : pl.getSample()) > -1 + && Objects.equals(sp.getStructureItemParameterId(), pl.getStructureItemParameterId())) { + pl.setId(sp.getId()); + // 娣诲姞鎺掑簭瀛楁 + pl.setSort(sp.getSort()); + if (sp.getState() != null && !sp.getState().equals("")) { + pl.setState(sp.getState()); + } else { + pl.setState(id == 0 ? 1 : 0); + } + if (sp.getMethodS() != null && !sp.getMethodS().equals("")) { + pl.setMethod(sp.getMethodS()); + } + if (sp.getRadius() != null && !sp.getRadius().equals("")) { + pl.setRadius(sp.getRadius()); + } + if (sp.getRates() != null && !sp.getRates().equals("")) { + pl.setRates(sp.getRates()); + } + if (sp.getAsk() != null && !sp.getAsk().equals("")) { + pl.setAsk(sp.getAsk()); + } + if (sp.getTell() != null && !sp.getTell().equals("")) { + pl.setTell(sp.getTell()); + } + if (sp.getPrice() != null && !sp.getPrice().equals("")) { + pl.setPrice(sp.getPrice()); + } + if (sp.getManHour() != null && !sp.getManHour().equals("")) { + pl.setManHour(sp.getManHour()); + } + if (sp.getSection() != null && !sp.getSection().equals("")) { + pl.setSection(sp.getSection()); + } + if (sp.getCores() != null && !sp.getCores().equals("")) { + pl.setCores(sp.getCores()); + } + if (sp.getConductorMaterial() != null && !sp.getConductorMaterial().equals("")) { + pl.setConductorMaterial(sp.getConductorMaterial()); + } + if (sp.getConductorType() != null && !sp.getConductorType().equals("")) { + pl.setConductorType(sp.getConductorType()); + } + if (sp.getTemplateId() != null && !sp.getTemplateId().equals("")) { + pl.setTemplateId(sp.getTemplateId()); + } + //鍥犱负杩樻湁涓骇鍝佸彨鑰愬紶绾垮す 鎺ョ画閲戝叿 ,杩欎袱涓」鐩殑鏁版嵁瀹屽叏涓�鏍�,鐗规畩澶勭悊 + if (sp.getTree() != null && !sp.getTree().equals("") && !pl.getTree().equals("涓ぉ绉戞妧妫�娴嬩腑蹇� - 鐢靛姏浜у搧瀹為獙瀹� - 閲戝叿 - 鑰愬紶绾垮す - null")) { + pl.setTree(sp.getTree()); + } + break; + } + } + } + if (page == 1) { + Integer userId = SecurityUtils.getUserId().intValue(); +// CompletableFuture.supplyAsync(() -> { + if (trees.length == 5) { + standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate() + .eq(StandardProductList::getStandardMethodListId, id) + .eq(StandardProductList::getTree, tree)); + } else { + standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate() + .eq(StandardProductList::getStandardMethodListId, id) + .like(StandardProductList::getTree, tree)); + } + + boolean success = false; + int retryCount = 0; + while (!success && retryCount < 100) { + try { + standardProductListService2.saveBatch(list.stream().map(a -> { + a.setFactory(trees[0]); + a.setLaboratory(trees[1]); + a.setSampleType(trees[2]); + a.setCreateUser(userId); + a.setUpdateUser(userId); + a.setStandardMethodListId(id); + return a; + }).collect(Collectors.toList())); + ; + success = true; + } catch (Exception e) { + // 澶勭悊閲嶅 ID 鐨勮褰曪紝閲嶆柊鐢熸垚 ID 骞剁户缁皾璇曟彃鍏� + for (StandardProductList productList : list) { + productList.setId(IdWorker.getId()); + } + } + } + if (!success) { + throw new RuntimeException("鎻掑叆澶辫触"); + } + + } + Map<String, Object> map = new HashMap<>(); + Collections.sort(list, (o1, o2) -> { + String field1 = o1.getManHourGroup(); + String field2 = o2.getManHourGroup(); + + boolean isEmpty1 = field1 == null || field1.isEmpty(); + boolean isEmpty2 = field2 == null || field2.isEmpty(); + + if (isEmpty1 && isEmpty2) { + return 0; + } else if (isEmpty1) { + return 1; + } else if (isEmpty2) { + return -1; + } else { + int num1 = extractNumber(field1); + int num2 = extractNumber(field2); + return Integer.compare(num1, num2); + } + }); + // 鎸夌収绱㈠紩鎺掑簭 + if (isDrag) { + list.sort((o1, o2) -> (o1.getSort() == null ? 0 : o1.getSort()) + - (o2.getSort() == null ? 0 : o2.getSort())); + } + try { + map.put("productList", list.subList((page - 1) * 300, page * 300)); + } catch (IndexOutOfBoundsException e) { + map.put("productList", list.subList((page - 1) * 300, list.size())); + } + map.put("total", list.size()); + return map; + } + + private int extractNumber(String s) { + // 浠庡瓧绗︿覆涓彁鍙栨暟瀛楃殑閫昏緫锛岃繖閲屽亣璁惧瓧娈电殑鏍煎紡鏄� "text<number>" + String number = s; + if (!s.matches("\\d+")) { + number = s.replaceAll("\\D", ""); + } + return Integer.parseInt(number); + } + + @Override + public IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items) { + IPage<StandardProductList> iPage = new Page<>(); + iPage.setSize(100); + iPage.setCurrent(page); + return standardProductListMapper.standardProductListIPage(id, tree, iPage, laboratory, item, items); + } + + @Override + public Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree, String item) { + HashMap<String, List<?>> map = new HashMap<>(); + map.put("item", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() + .eq(StandardProductList::getStandardMethodListId, id) + .like(StandardProductList::getTree, tree) + .select(StandardProductList::getInspectionItem) + .groupBy(StandardProductList::getInspectionItem))); + if (ObjectUtils.isNotEmpty(item)) { + map.put("items", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() + .eq(StandardProductList::getStandardMethodListId, id) + .eq(StandardProductList::getInspectionItem, item) + .like(StandardProductList::getTree, tree) + .select(StandardProductList::getInspectionItemSubclass) + .groupBy(StandardProductList::getInspectionItemSubclass))); + } else { + map.put("items", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() + .eq(StandardProductList::getStandardMethodListId, id) + .like(StandardProductList::getTree, tree) + .select(StandardProductList::getInspectionItemSubclass) + .groupBy(StandardProductList::getInspectionItemSubclass))); + } + return map; + } + + /** + * 淇敼鏍囧噯搴撳尯闂� + * @param list + * @return + */ + @Override + public boolean updateSection(StandardProductList list) { + standardProductListMapper.updateSection(list); + return true; + } + + + /** + * 鏍囧噯搴撴嫋鎷� + * @param resetTreeDragDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void resetTreeDrag(ResetTreeDragDTO resetTreeDragDTO) { + Integer beginIndex = Integer.parseInt(resetTreeDragDTO.getBeginIndex()); + Integer endIndex = Integer.parseInt(resetTreeDragDTO.getEndIndex()); + Integer methodId = Integer.parseInt(resetTreeDragDTO.getMethodId()); + Long productionId = Long.parseLong(resetTreeDragDTO.getProductionId()); + // 鍒ゆ柇鏄粠涓婂線涓嬫嫋鎷借繕鏄粠涓嬪線涓婃斁鎷栨嫿 + // 浠庝笂寰�涓� + if (beginIndex < endIndex) { + standardProductListMapper.updateSortUp(beginIndex, + endIndex, + methodId, + resetTreeDragDTO.getTree()); + + // 浠庝笅寰�涓� + } else if (beginIndex > endIndex){ + standardProductListMapper.updateSortDown(beginIndex, + endIndex, + methodId, + resetTreeDragDTO.getTree()); + } else { + return; + } + // 淇敼鏍囧噯搴撻」椤哄簭 + standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate() + .eq(StandardProductList::getId, productionId) + .set(StandardProductList::getSort, endIndex)); + } + + @Override + public void resetTreeDragBatch(List<StandardProductList> standardProductLists) { + standardProductListService2.updateBatchById(standardProductLists); + } + + /** + * 妫�楠岄」瑕佹眰鍊煎姣� + * @param copyDto + * @return + */ + @Override + public List<StandardProductList> copyStandardProductList(CopyStandardProductListDto copyDto) { + List<StandardProductList> productLists = new ArrayList<>(); + + // 瀵规瘮妫�楠岄」涓�鏍风殑濉厖瑕佹眰鍊艰姹傛弿杩� + for (StandardProductList oldProductList : copyDto.getOldStandardProductList()) { + String oldItemName = oldProductList.getInspectionItemClassEn() + + oldProductList.getInspectionItem() + + oldProductList.getInspectionItemSubclass(); + for (StandardProductList newProductList : copyDto.getNewStandardProductList()) { + String newItemName = newProductList.getInspectionItemClassEn() + + newProductList.getInspectionItem() + + newProductList.getInspectionItemSubclass(); + // 鍒ゆ柇鍚嶇О鏄惁涓�鏍� + if (oldItemName.equals(newItemName)) { + // 鍖洪棿 + oldProductList.setSection(newProductList.getSection()); + // 鑺暟 + oldProductList.setCores(newProductList.getCores()); + // 瑕佹眰鍊� + oldProductList.setAsk(newProductList.getAsk()); + // 瑕佹眰鎻忚堪 + oldProductList.setTell(newProductList.getTell()); + // 鍗曚环 + oldProductList.setPrice(newProductList.getPrice()); + // 宸ユ椂鍒嗙粍 + oldProductList.setManHour(newProductList.getManHour()); + // 瀵间綋鏉愯川 + oldProductList.setConductorMaterial(newProductList.getConductorMaterial()); + // 瀵间綋绫诲瀷 + oldProductList.setConductorType(newProductList.getConductorType()); + productLists.add(oldProductList); + } + } + } + return productLists; + } + + /** + * 妫�楠岄」澶嶅埗瀵规瘮涓�涓� + * @param dto + * @return + */ + @Override + public List<StandardProductList> copyStandardProductOne(CopyStandardProductListDto dto) { + if (CollectionUtils.isEmpty(dto.getNewStandardProductList()) && dto.getNewStandardProductList().size() == 1 && + CollectionUtils.isEmpty(dto.getOldStandardProductList()) && dto.getOldStandardProductList().size() == 1) { + throw new BaseException("闇�瑕佸姣旂殑妫�楠岄」璇烽�夋嫨涓�涓�"); + } + StandardProductList newProductList = dto.getNewStandardProductList().get(0); + StandardProductList oldProductList = dto.getOldStandardProductList().get(0); + // 鍖洪棿 + oldProductList.setSection(newProductList.getSection()); + // 鑺暟 + oldProductList.setCores(newProductList.getCores()); + // 瑕佹眰鍊� + oldProductList.setAsk(newProductList.getAsk()); + // 瑕佹眰鎻忚堪 + oldProductList.setTell(newProductList.getTell()); + // 鍗曚环 + oldProductList.setPrice(newProductList.getPrice()); + // 宸ユ椂鍒嗙粍 + oldProductList.setManHour(newProductList.getManHour()); + // 瀵间綋鏉愯川 + oldProductList.setConductorMaterial(newProductList.getConductorMaterial()); + // 瀵间綋绫诲瀷 + oldProductList.setConductorType(newProductList.getConductorType()); + List<StandardProductList> productLists = new ArrayList<>(); + productLists.add(oldProductList); + return productLists; + } + + /** + * 妫�楠岄」澶嶅埗鎺掑簭 + * @param copyDto + * @return + */ + @Override + public boolean copyStandardProductSort(CopyStandardProductListDto copyDto) { + List<StandardProductList> productLists = new ArrayList<>(); + + // 瀵规瘮妫�楠岄」涓�鏍风殑濉厖瑕佹眰鍊艰姹傛弿杩� + for (StandardProductList oldProductList : copyDto.getOldStandardProductList()) { + String oldItemName = oldProductList.getInspectionItemClassEn() + + oldProductList.getInspectionItem() + + oldProductList.getInspectionItemSubclass(); + for (StandardProductList newProductList : copyDto.getNewStandardProductList()) { + String newItemName = newProductList.getInspectionItemClassEn() + + newProductList.getInspectionItem() + + newProductList.getInspectionItemSubclass(); + // 鍒ゆ柇鍚嶇О鏄惁涓�鏍� + if (oldItemName.equals(newItemName)) { + StandardProductList standardProductList = new StandardProductList(); + standardProductList.setId(oldProductList.getId()); + // 澶嶅埗鎺掑簭 + standardProductList.setSort(newProductList.getSort()); + productLists.add(standardProductList); + } + } + } + this.updateBatchById(productLists); + return false; + } +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListSupplierAskServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListSupplierAskServiceImpl.java new file mode 100644 index 0000000..95ac78d --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListSupplierAskServiceImpl.java @@ -0,0 +1,79 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.basic.mapper.StandardProductListSupplierAskMapper; +import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; +import com.ruoyi.basic.service.StandardProductListSupplierAskService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 妫�楠岄」鐩巶瀹跺瘑搴︾粦瀹氳〃 + * + * @author zhuo + * @since 2024-09-23 + */ +@Service +public class StandardProductListSupplierAskServiceImpl extends ServiceImpl<StandardProductListSupplierAskMapper, StandardProductListSupplierAsk> implements StandardProductListSupplierAskService { + + /** + * 鏌ヨ鍘傚瑕佹眰鍊肩粦瀹� + * @param supplierAsk + * @return + */ + @Override + public List<StandardProductListSupplierAsk> selectByProductId(StandardProductListSupplierAsk supplierAsk) { + if (supplierAsk.getProductListId() == null) { + throw new BaseException("缂哄皯妫�楠岄」id"); + } + return baseMapper.selectList(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() + .eq(StandardProductListSupplierAsk::getProductListId, supplierAsk.getProductListId())); + } + + /** + * 鏂板鍘傚瑕佹眰鍊肩粦瀹� + * @param supplierAsk + * @return + */ + @Override + public Integer addProductSupplierAsk(StandardProductListSupplierAsk supplierAsk) { + if (supplierAsk.getProductListId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + // 鏌ヨ鏀瑰巶瀹舵槸鍚︾粦瀹氳繃 + Long count = baseMapper.selectCount(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() + .eq(StandardProductListSupplierAsk::getProductListId, supplierAsk.getProductListId()) + .eq(StandardProductListSupplierAsk::getSupplierName, supplierAsk.getSupplierName())); + if (count > 0){ + throw new BaseException("璇ヤ骇鍝佸凡缁戝畾杩囪鍘傚"); + } + baseMapper.insert(supplierAsk); + return supplierAsk.getSupplierAskId(); + } + + /** + * 淇敼鍘傚瑕佹眰鍊肩粦瀹� + * @param supplierAsk + * @return + */ + @Override + public Integer updateProductSupplierAsk(StandardProductListSupplierAsk supplierAsk) { + if (supplierAsk.getProductListId() == null) { + throw new BaseException("缂哄皯妫�楠岄」id"); + } + // 鏌ヨ鏀瑰巶瀹舵槸鍚︾粦瀹氳繃 + Long count = baseMapper.selectCount(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() + .ne(StandardProductListSupplierAsk::getSupplierAskId, supplierAsk.getSupplierAskId()) + .eq(StandardProductListSupplierAsk::getProductListId, supplierAsk.getProductListId()) + .eq(StandardProductListSupplierAsk::getSupplierName, supplierAsk.getSupplierName())); + if (count > 0){ + throw new BaseException("璇ユ楠岄」宸茬粦瀹氳繃璇ュ巶瀹�"); + } + baseMapper.updateById(supplierAsk); + return supplierAsk.getSupplierAskId(); + } +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTemplateServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTemplateServiceImpl.java new file mode 100644 index 0000000..f1f3ba4 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTemplateServiceImpl.java @@ -0,0 +1,130 @@ +package com.ruoyi.basic.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +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.common.numgen.NumberGenerator; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.StandardTemplateMapper; +import com.ruoyi.basic.pojo.StandardTemplate; +import com.ruoyi.basic.service.StandardTemplateService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** +* @author Administrator +* @description 閽堝琛ㄣ�恠tandard_template(鏍囧噯妯℃澘)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 +* @createDate 2024-03-11 13:47:52 +*/ +@Service +@AllArgsConstructor +public class StandardTemplateServiceImpl extends ServiceImpl<StandardTemplateMapper, StandardTemplate> + implements StandardTemplateService{ + + private StandardTemplateMapper standardTemplateMapper; + + + private final NumberGenerator<StandardTemplate> numberGenerator; + + @Override + public IPage<StandardTemplate> selectStandardTemplatePageList(Page page, StandardTemplate standardTemplate) { + return standardTemplateMapper.selectStandardTemplatePageList(page, QueryWrappers.queryWrappers(standardTemplate)); + } + + @Override + public int addStandardTemplate(StandardTemplate standardTemplate) { + if (StringUtils.isBlank(standardTemplate.getNumber())) { + String giveCode = numberGenerator.generateNumberWithPrefix(5, + "MB" + DateUtil.format(new Date(), "yyMM"), + StandardTemplate::getNumber); + standardTemplate.setNumber(giveCode); + } + return standardTemplateMapper.insert(standardTemplate); + } + + @Override + public int upStandardTemplate(StandardTemplate standardTemplate) { + if(standardTemplate.getThing().equals("")){ + standardTemplate.setThing(null); + } + return standardTemplateMapper.updateById(standardTemplate); + } + + @Override + public int delStandardTemplate(Integer id) { + return standardTemplateMapper.deleteById(id); + } + + @Override + public List<StandardTemplate> getStandardTemplate() { + return standardTemplateMapper.selectList(Wrappers.<StandardTemplate>lambdaQuery().select(StandardTemplate::getId,StandardTemplate::getName)); + } + + @Override + public String getStandTempThingById(Integer templateId) { + StandardTemplate standardTemplate = standardTemplateMapper.selectOne(Wrappers.<StandardTemplate>lambdaQuery() + .eq(StandardTemplate::getId, templateId) + .select(StandardTemplate::getThing)); + if(standardTemplate==null){ + return null; + }else{ + return standardTemplate.getThing(); + } + // 鏌ヨ鍘嬬缉鍚庣殑鏁版嵁 +// String thing = standardTemplateMapper.selectCompressThing(templateId); +// if (StringUtils.isNotBlank(thing)) { +// try { +// return DecompressMySQLData.decompress(java.util.Base64.getDecoder().decode(thing)); +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// } else { +// return null; +// } + } + + @Override + public String getStandTempNameById(Integer templateId) { + StandardTemplate standardTemplate = standardTemplateMapper.selectOne(Wrappers.<StandardTemplate>lambdaQuery() + .eq(StandardTemplate::getId, templateId) + .select(StandardTemplate::getName)); + if(standardTemplate==null){ + return null; + }else{ + return standardTemplate.getName(); + } + } + + @Override + public StandardTemplate getStandTempIdByName(String name) { + return standardTemplateMapper.getStandTempIdByName(name); + } + + /** + * 澶嶅埗鍘熷璁板綍妯℃澘 + * @param newTemplate + * @return + */ + @Override + public int copyStandardTemplate(StandardTemplate newTemplate) { + // 鏌ヨ鏃фā鏉� + StandardTemplate standardTemplate = baseMapper.selectById(newTemplate.getId()); + newTemplate.setThing(standardTemplate.getThing()); + + if (StringUtils.isBlank(newTemplate.getNumber())) { + String giveCode = numberGenerator.generateNumberWithPrefix(5, + "MB" + DateUtil.format(new Date(), "yyMM"), + StandardTemplate::getNumber); + newTemplate.setNumber(giveCode); + } + newTemplate.setId(null); + + return standardTemplateMapper.insert(newTemplate); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java new file mode 100644 index 0000000..b64ab41 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java @@ -0,0 +1,535 @@ +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.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 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.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +/** + * @author Administrator + * @description 閽堝琛ㄣ�恠tandard_tree(鏍囧噯鏍�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 + * @createDate 2024-03-01 15:06:44 + */ +@Service +@AllArgsConstructor +public class StandardTreeServiceImpl extends ServiceImpl<StandardTreeMapper, StandardTree> + implements StandardTreeService { + + + private StandardTreeMapper standardTreeMapper; + + private StandardMethodListService standardMethodListService; + + private StandardProductListMapper standardProductListMapper; + + private StandardProductListService standardProductListService; + + private StandardTemplateService standardTemplateService; + + private StructureTestObjectService structureTestObjectService; + + + @Override + public List<FactoryDto> selectStandardTreeList() { + List<FactoryDto> factoryDtos = standardTreeMapper.selectStandardTreeList(); + for (FactoryDto factoryDto : factoryDtos) { + for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) { + laboratoryDto.getChildren().sort((o1, o2) -> (o1.getSort() == null ? 0 : o1.getSort()) + - (o2.getSort() == null ? 0 : o2.getSort())); + for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) { +// if (sampleTypeDto.getChildren().size() == 0) { + sampleTypeDto.getChildren().addAll(standardTreeMapper.getStandardTree3(sampleTypeDto.getValue())); +// } + } + } + } + return factoryDtos; + } + + + + @Override + @Transactional(rollbackFor = Exception.class) + public int addStandardTree(StandardTree standardTree) { + LambdaQueryWrapper<StandardTree> wrapper = Wrappers.<StandardTree>lambdaQuery() + .eq(StandardTree::getFactory, standardTree.getFactory()) + .eq(StandardTree::getLaboratory, standardTree.getLaboratory()) + .eq(StandardTree::getSampleType, standardTree.getSampleType()) + .eq(StandardTree::getSample, standardTree.getSample()) + .eq(StandardTree::getModel, standardTree.getModel()); + if (StringUtils.isNotBlank(standardTree.getSample())) { + wrapper.eq(StandardTree::getSample, standardTree.getSample()); + } + + StandardTree tree = standardTreeMapper.selectOne(wrapper); + if (tree != null) { + throw new BaseException("璇ュ瀷鍙峰凡瀛樺湪"); + } + return standardTreeMapper.insert(standardTree); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int delStandardTree(String tree) { + String[] trees = tree.split(" - "); + switch (trees.length) { + case 5: + if (trees[3].equals("null")) { + standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).isNull(StandardTree::getSample).eq(StandardTree::getModel, trees[4])); + } else { + standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]).eq(StandardTree::getModel, trees[4])); + } + break; + /*case 4: + standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3])); + break; + case 3: + standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2])); + break; + case 2: + standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1])); + break; + case 1: + standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0])); + break;*/ + } + return 1; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int addStandardProduct(String ids, String tree) { + String[] trees = tree.split(" - "); + JSONArray jsonArray = JSON.parseArray(ids); + for (Object o : jsonArray) { + StandardProductList standardProductList = standardTreeMapper.selectStandardProductById(Integer.parseInt("" + o)); + standardProductList.setFactory(trees[0]); + try { + standardProductList.setLaboratory(trees[1]); + } catch (Exception e) { + } + try { + standardProductList.setSampleType(trees[2]); + } catch (Exception e) { + } + try { + standardProductList.setSample(trees[3]); + } catch (Exception e) { + } + try { + standardProductList.setModel(trees[4]); + } catch (Exception e) { + } + standardProductListMapper.insert(standardProductList); + } + return 1; + } + + @Override + public List<SampleTypeDto> getStandardTree2() { + return standardTreeMapper.getStandardTree2(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int upStandardProducts(Map<String, Object> product) { + List<Integer> ids = JSON.parseArray(product.get("ids") + ""); + StandardProductList productList = JSON.parseObject(JSON.toJSONString(product.get("standardProductList")), StandardProductList.class); + if (productList.getMethodS() != null) { + standardProductListMapper.update(productList, Wrappers.<StandardProductList>lambdaUpdate().in(StandardProductList::getId, ids).like(StandardProductList::getMethod, productList.getMethodS())); + return 1; + } + if (productList.getRadiusList() != null) { + standardProductListMapper.update(productList, Wrappers.<StandardProductList>lambdaUpdate().in(StandardProductList::getId, ids).like(StandardProductList::getRadiusList, productList.getRadius())); + return 1; + } + standardProductListMapper.update(productList, Wrappers.<StandardProductList>lambdaUpdate().in(StandardProductList::getId, ids)); + return 1; + } + + @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) { + for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) { + List<SampleTypeDto> children = laboratoryDto.getChildren(); + int sort = 0; + // 寰幆绗笁灞� + for (SampleTypeDto child : children) { + StructureTestObject structureTestObject = new StructureTestObject(); + structureTestObject.setSort(sort); + structureTestObject.setId(child.getSampleTypeId()); + testObjects.add(structureTestObject); + sort++; + } + } + } + structureTestObjectService.updateBatchById(testObjects); + + return true; + } + + /** + * 淇敼鏍囧噯鏁� + * @param standardTree + * @return + */ + @Override + public int updateStandardTree(StandardTree standardTree) { + // 淇敼鍚嶇О鍖归厤鐨勬爣鍑嗘爲涓嬬殑妫�楠岄」鐩� + // 鏌ヨ鎵�鏈夊璞�+鍚嶇О鐨勬爲 + + List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate() + .eq(StandardProductList::getSample, standardTree.getSample()) + .eq(StandardProductList::getSampleType, standardTree.getSampleType()) + .eq(StandardProductList::getModel, standardTree.getOldModel())); + if (CollectionUtils.isNotEmpty(standardProductLists)) { + for (StandardProductList standardProductList : standardProductLists) { + // 淇敼鏍峰搧鍚嶇О + standardProductList.setModel(standardTree.getModel()); + // 淇敼鏍戝悕绉� + // 闇�瑕佹埅鍙栫鍥涚骇, 閬垮厤涓夊洓绾у悕绉颁竴鏍蜂慨鏀归敊璇� + String[] trees = standardProductList.getTree().split(" - "); + trees[4] = standardTree.getModel(); + List<String> list = CollUtil.newArrayList(trees); + String newName = CollUtil.join(list, " - "); + standardProductList.setTree(newName); + } + standardProductListService.updateBatchById(standardProductLists); + } + + // 淇敼鏍囧噯鏁版楠岄」鐩� + LambdaUpdateWrapper<StandardTree> wrapper = Wrappers.<StandardTree>lambdaUpdate() + .eq(StandardTree::getFactory, standardTree.getFactory()) + .eq(StandardTree::getLaboratory, standardTree.getLaboratory()) + .eq(StandardTree::getSampleType, standardTree.getSampleType()) + .eq(StandardTree::getModel, standardTree.getOldModel()) + .set(StandardTree::getModel, standardTree.getModel()); + if (StringUtils.isNotBlank(standardTree.getSample())) { + wrapper.eq(StandardTree::getSample, standardTree.getSample()); + } + 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)); + } + +} + + + + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureItemParameterServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureItemParameterServiceImpl.java new file mode 100644 index 0000000..4009106 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureItemParameterServiceImpl.java @@ -0,0 +1,24 @@ +package com.ruoyi.basic.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.basic.mapper.StructureItemParameterMapper; +import com.ruoyi.basic.pojo.StructureItemParameter; +import com.ruoyi.basic.service.StructureItemParameterService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +@Service +@AllArgsConstructor +public class StructureItemParameterServiceImpl extends ServiceImpl<StructureItemParameterMapper, StructureItemParameter> implements StructureItemParameterService { + + @Resource + private StructureItemParameterMapper structureItemParameterMapper; + + @Override + public void removeNoSample(String sample) { + structureItemParameterMapper.removeNoSample("\""+sample+"\""); + } +} diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java new file mode 100644 index 0000000..819ef16 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java @@ -0,0 +1,75 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +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.common.exception.base.BaseException; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.basic.mapper.ProductPartMapper; +import com.ruoyi.basic.mapper.StructureTestObjectPartMapper; +import com.ruoyi.basic.pojo.ProductPart; +import com.ruoyi.basic.pojo.StructureTestObjectPart; +import com.ruoyi.basic.service.StructureTestObjectPartService; + +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 妫�楠屽璞¢浂浠惰〃 + * + * @author zhuo + * @since 2024-08-07 + */ +@Transactional +@Service +@AllArgsConstructor +public class StructureTestObjectPartServiceImpl extends ServiceImpl<StructureTestObjectPartMapper, StructureTestObjectPart> implements StructureTestObjectPartService { + + private ProductPartMapper productPartMapper; + + @Override + public IPage<StructureTestObjectPart> selectByTestObjectId(Page page, StructureTestObjectPart structureTestObjectPart) { + return baseMapper.selectListByTestObjectId(page, QueryWrappers.queryWrappers(structureTestObjectPart),structureTestObjectPart.getTestObjectId()); + } + + @Override + public void addTestObjectPart(StructureTestObjectPart structureTestObjectPart) { + this.isPartNoExist(structureTestObjectPart.getPartNo(), null); + if (structureTestObjectPart.getTestObjectId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + baseMapper.insert(structureTestObjectPart); + } + + @Override + public void updateTestObjectPart(StructureTestObjectPart structureTestObjectPart) { + this.isPartNoExist(structureTestObjectPart.getPartNo(), structureTestObjectPart.getId()); + if (structureTestObjectPart.getTestObjectId() == null) { + throw new BaseException("缂哄皯浜у搧瀵硅薄id"); + } + baseMapper.updateById(structureTestObjectPart); + } + + // 鍒ゆ柇闆朵欢鍙锋槸鍚﹀瓨鍦� + public void isPartNoExist(String partNo, Integer id) { + // 闆朵欢鍙峰敮涓� 浣嗕笉蹇呭~ + if (StringUtils.isNotBlank(partNo)) { + Long count = productPartMapper.selectCount(new LambdaQueryWrapper<ProductPart>() + .eq(ProductPart::getPartNo, partNo)); + Long selectCount = baseMapper.selectCount(Wrappers.<StructureTestObjectPart>lambdaQuery() + .eq(StructureTestObjectPart::getPartNo, partNo) + .ne(id != null, StructureTestObjectPart::getId, id)); + if (count > 0 || selectCount > 0) { + throw new BaseException("璇ラ浂浠跺彿宸茬粦瀹氳繃妫�楠屽璞�"); + } + } else { + throw new BaseException("璇疯緭鍏ラ浂浠跺彿"); + } + } +} + diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectServiceImpl.java new file mode 100644 index 0000000..60f0f40 --- /dev/null +++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectServiceImpl.java @@ -0,0 +1,19 @@ +package com.ruoyi.basic.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.basic.mapper.StructureTestObjectMapper; +import com.ruoyi.basic.pojo.StructureTestObject; +import com.ruoyi.basic.service.StructureTestObjectService; +import org.springframework.stereotype.Service; + +/** + * 妫�娴嬪璞� + * + * @author zhuo + * @since 2024-09-13 + */ +@Service +public class StructureTestObjectServiceImpl extends ServiceImpl<StructureTestObjectMapper, StructureTestObject> implements StructureTestObjectService { + +} + diff --git a/basic-server/src/main/resources/mapper/CertificationMapper.xml b/basic-server/src/main/resources/mapper/CertificationMapper.xml new file mode 100644 index 0000000..4926d05 --- /dev/null +++ b/basic-server/src/main/resources/mapper/CertificationMapper.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.ruoyi.basic.mapper.CertificationMapper"> + <select id="getCertificationDetail" resultType="com.ruoyi.basic.pojo.Certification"> + select b.* + from ( select a.`name`, a.`code`,a.organization,a.explanation,a.first_issuance_date,a.latest_issuance_date,c.expire_time FROM + (SELECT id,name,MIN(date_of_issuance) AS first_issuance_date, + MAX(date_of_issuance) AS latest_issuance_date, + c.`code`,c.organization,c.explanation + FROM + certification c + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + GROUP BY + name) a left join certification c on a.id=c.id + ) b + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/IfsInventoryQuantityMapper.xml b/basic-server/src/main/resources/mapper/IfsInventoryQuantityMapper.xml new file mode 100644 index 0000000..2b615be --- /dev/null +++ b/basic-server/src/main/resources/mapper/IfsInventoryQuantityMapper.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.ruoyi.basic.mapper.IfsInventoryQuantityMapper"> + + <select id="printLabel" resultType="com.ruoyi.basic.dto.IfsInventoryQuantityDto"> + SELECT io.sample sample_name, + iiq.supplier_name, + io.part_detail part_desc, + io.send_time, + io.prepare_user, + io.entrust_code, + iiq.qty_arrived, + iiq.buy_unit_meas, + CASE + WHEN pp.color IS NOT NULL + THEN pp.color + ELSE sto.color + END color, + case + when iiq.state = 2 then '2' + when iiq.state = 1 then case + when ROUND((select count(*) + from ins_product ip + where state = 1 + and ins_result is not null + and ip.ins_sample_id in (select id + from ins_sample + where ins_sample.ins_order_id = io.id)) / + (select count(*) + from ins_product ip2 + where state = 1 + and ip2.ins_sample_id in + (select id from ins_sample where ins_sample.ins_order_id = io.id)) * + 100, 2) != 100 then '0' + else '1' end + end labelStatus, + JSON_OBJECT( + 'sample_ame', io.sample, + 'supplier_name', iiq.supplier_name, + 'part_desc', iiq.part_desc, + 'entrust_code', io.entrust_code + ) labelBarCode + FROM ifs_inventory_quantity iiq + LEFT JOIN ins_order io on io.id = (SELECT io2.id + FROM ins_order io2 + WHERE io2.ifs_inventory_id = iiq.id + and io2.state != -1 + order by io2.send_time desc + limit 1) COLLATE utf8mb4_general_ci + LEFT JOIN product_part pp ON pp.part_no = iiq.part_no COLLATE utf8mb4_general_ci + LEFT JOIN structure_test_object_part sto ON sto.part_no = iiq.part_no COLLATE utf8mb4_general_ci + WHERE iiq.id in + <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> + #{val} + </foreach> + </select> + <select id="selectReportCountById" resultType="java.lang.Integer"> + select count(*) + from ifs_inventory_quantity iiq + left join ins_order io on io.ifs_inventory_id = iiq.id and io.state + left join ins_report ir on ir.ins_order_id = io.id + where iiq.id = #{ifsInventoryId} + and ir.id is not null + </select> + <select id="selectIsFirst" resultType="java.lang.Integer"> + select count(*) + from ifs_inventory_quantity iiq + LEFT JOIN ins_order io1 on io1.ifs_inventory_id = iiq.id + and io1.state != -1 + where io1.part_detail = #{partDetail} + and iiq.supplier_name = #{supplierName} + and iiq.receiver_date between #{startOfNextQuarter} and #{endOfQuarter} + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/LaboratoryMapper.xml b/basic-server/src/main/resources/mapper/LaboratoryMapper.xml new file mode 100644 index 0000000..c3ab2b4 --- /dev/null +++ b/basic-server/src/main/resources/mapper/LaboratoryMapper.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.LaboratoryMapper"> + + <select id="selectItemParameter" resultType="com.ruoyi.basic.pojo.Laboratory"> + select * from + ( + select l.id, + laboratory_name, + laboratory_number, + laboratory_code, + phone_number, + head, + l.address, + u1.name create_user_name, + l.create_time + from laboratory l + left join user u1 on l.create_user = u1.id + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + + <select id="obtainItemParameterList" resultType="java.lang.Object"> + select * from + ( + select l.id, + laboratory_name, + laboratory_number, + phone_number, + head, + l.address, + u1.name create_user_name, + l.create_time + from laboratory l + left join user u1 on l.create_user = u1.id + ) a + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/ProductMapper.xml b/basic-server/src/main/resources/mapper/ProductMapper.xml new file mode 100644 index 0000000..a13b18d --- /dev/null +++ b/basic-server/src/main/resources/mapper/ProductMapper.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.ProductMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.Product"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="name" column="name" jdbcType="VARCHAR"/> + <result property="nameEn" column="name_en" jdbcType="VARCHAR"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + <result property="objectId" column="object_id" jdbcType="INTEGER"/> + </resultMap> + + <sql id="Base_Column_List"> + id,name,name_en, + create_user,update_user,create_time, + update_time,object_id + </sql> + <select id="selectProductListByObjectId" resultType="com.ruoyi.basic.pojo.Product"> + select * from ( + select p.id, + p.name, + p.name_en, + p.create_user, + p.update_user, + p.create_time, + p.update_time, + p.object_id + from product p + WHERE 1=1 + <if test="partNo != null and partNo != ''"> + and p.id = (select pp.product_id + from product_part pp + where pp.part_no = #{partNo}) + </if>) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/ProductPartMapper.xml b/basic-server/src/main/resources/mapper/ProductPartMapper.xml new file mode 100644 index 0000000..f883d3c --- /dev/null +++ b/basic-server/src/main/resources/mapper/ProductPartMapper.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.ProductPartMapper"> + <select id="selectListByProductId" resultType="com.ruoyi.basic.pojo.ProductPart"> + SELECT * from product_part pp + where pp.product_id=#{productId} + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/ProductSupplierDensityMapper.xml b/basic-server/src/main/resources/mapper/ProductSupplierDensityMapper.xml new file mode 100644 index 0000000..4f47e62 --- /dev/null +++ b/basic-server/src/main/resources/mapper/ProductSupplierDensityMapper.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.ruoyi.basic.mapper.ProductSupplierDensityMapper"> + <select id="selectListByProductId" resultType="com.ruoyi.basic.pojo.ProductSupplierDensity"> + SELECT * from product_supplier_density pp + where pp.product_id=#{productId} + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/StandardMethodListMapper.xml b/basic-server/src/main/resources/mapper/StandardMethodListMapper.xml new file mode 100644 index 0000000..957fd1f --- /dev/null +++ b/basic-server/src/main/resources/mapper/StandardMethodListMapper.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StandardMethodListMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardMethodList"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="code" column="code" jdbcType="VARCHAR"/> + <result property="name" column="name" jdbcType="VARCHAR"/> + <result property="remark" column="remark" jdbcType="VARCHAR"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + </resultMap> + + <select id="selectStandardMethodById" resultType="java.util.Map"> + select code, name, remark + from standard_method + where id = #{id} + </select> + <select id="selectUserById" resultType="java.lang.String"> + select name + from user + where 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="selectParameterList" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select inspection_item, + inspection_item_subclass, + laboratory, + unit, + price, + man_hour, + man_hour_group, + inspection_item_type, + inspection_value_type, + checkout_number, + section, + method, + man_day, + bsm, + template_id, + son_laboratory + from structure_item_parameter + where method = #{code} + </select> + <select id="selectStandardMethodLists2" resultType="com.ruoyi.basic.pojo.StandardMethodList"> + select sml.id, sml.code, sml.name,sml.remark, sml.create_time, u.name create_user_name + from standard_method_list sml + left join user u on u.id = sml.create_user + where factory = #{data1} + <if test="data2 != null"> + and laboratory = #{data2} + </if> + <if test="data3 != null"> + and sample_type = #{data3} + </if> + <if test="data4 != null"> + and sample = #{data4} + </if> + <if test="data5 != null"> + and model = #{data5} + </if> + </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> diff --git a/basic-server/src/main/resources/mapper/StandardMethodMapper.xml b/basic-server/src/main/resources/mapper/StandardMethodMapper.xml new file mode 100644 index 0000000..739d2d4 --- /dev/null +++ b/basic-server/src/main/resources/mapper/StandardMethodMapper.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StandardMethodMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardMethod"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="code" column="code" jdbcType="VARCHAR"/> + <result property="name" column="name" jdbcType="VARCHAR"/> + <result property="remark" column="remark" jdbcType="VARCHAR"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + </resultMap> + + <select id="selectStandardMethodList" resultType="com.ruoyi.basic.pojo.StandardMethod"> + select * from ( + select sm.id, + sm.code, + sm.name, + sm.structure_test_object_id, + sto.specimen_name sample_type, + sm.remark, + u1.name create_user_name, + sm.create_time, + u2.name update_user_name, + sm.update_time, + sm.is_product, + sm.field, + sm.name_en, + sm.is_use, + sm.qualification_id + from standard_method sm + left join user u1 on sm.create_user = u1.id + left join user u2 on sm.update_user = u2.id + left join structure_test_object sto on sm.structure_test_object_id = sto.id + where sm.code != '鎶�鏈姹�' + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + <select id="selectStandMethodById" resultType="com.ruoyi.basic.pojo.StandardMethod"> + select sm.id, + sm.code, + sm.name, + sm.structure_test_object_id, + sto.specimen_name sample_type, + sm.remark, + u1.name create_user_name, + sm.create_time, + u2.name update_user_name, + sm.update_time, + sm.is_product, + sm.field, + sm.name_en, + sm.is_use, + sm.qualification_id + from standard_method sm + left join user u1 on sm.create_user = u1.id + left join user u2 on sm.update_user = u2.id + left join structure_test_object sto on sm.structure_test_object_id = sto.id + where sm.id = #{id} + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/StandardProductListMapper.xml b/basic-server/src/main/resources/mapper/StandardProductListMapper.xml new file mode 100644 index 0000000..8223bfc --- /dev/null +++ b/basic-server/src/main/resources/mapper/StandardProductListMapper.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StandardProductListMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardProductList"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/> + <result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/> + <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> + <result property="unit" column="unit" jdbcType="VARCHAR"/> + <result property="price" column="price" jdbcType="DECIMAL"/> + <result property="manHour" column="man_hour" jdbcType="INTEGER"/> + <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/> + <result property="inspectionItemType" column="inspection_item_type" jdbcType="VARCHAR"/> + <result property="inspectionValueType" column="inspection_value_type" jdbcType="VARCHAR"/> + <result property="checkoutNumber" column="checkout_number" jdbcType="INTEGER"/> + <result property="section" column="section" jdbcType="VARCHAR"/> + <result property="method" column="method" jdbcType="VARCHAR"/> + <result property="manDay" column="man_day" jdbcType="INTEGER"/> + <result property="bsm" column="bsm" jdbcType="VARCHAR"/> + <result property="ask" column="ask" jdbcType="VARCHAR"/> + <result property="standardMethodListId" column="standard_method_list_id" jdbcType="INTEGER"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + </resultMap> + <update id="updateSection"> + UPDATE standard_product_list + SET price=#{productList.price}, + man_hour=#{productList.manHour}, + section=#{productList.section}, + cores=#{productList.cores}, + conductor_material=#{productList.conductorMaterial}, + conductor_type=#{productList.conductorType}, + ask=#{productList.ask}, + tell=#{productList.tell}, + update_user=#{productList.updateUser}, + update_time=#{productList.updateTime} + WHERE id = #{productList.id} + </update> + <update id="updateSortUp"> + update standard_product_list + set sort = sort - 1 + where tree = #{tree} + and standard_method_list_id = #{methodId} + and sort between #{beginIndex} + 1 and #{endIndex} + </update> + <update id="updateSortDown"> + update standard_product_list + set sort = sort + 1 + where tree = #{tree} + and standard_method_list_id = #{methodId} + and sort between #{endIndex} and #{beginIndex} - 1 + </update> + <select id="standardProductListIPage" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select spl.* from standard_product_list spl + left join product p on spl.sample = p.name + where standard_method_list_id = #{id} + and tree like concat('%',#{tree},'%') + <if test="laboratory != ''"> + and son_laboratory = #{laboratory} + </if> + <if test="insItem != ''"> + and inspection_item = #{insItem} + </if> + <if test="insItems != ''"> + and inspection_item_subclass = #{insItems} + </if> + group by spl.id + order by p.id + </select> + <select id="getOne" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select * from standard_product_list + where standard_method_list_id = #{standardMethodListId} + and inspection_item = #{inspectionItem} + <if test="sample!=null"> + and sample = #{sample} + </if> + <if test="inspectionItemSubclass!=null"> + and inspection_item_subclass = #{inspectionItemSubclass} + </if> + <if test="inspectionItemSubclass == null"> + and (inspection_item_subclass is null or inspection_item_subclass = '') + </if> + <if test="model!=null"> + and model = #{model} + </if> + <if test="inspectionItemClass != null and inspectionItemClass != ''"> + and inspection_item_class = #{inspectionItemClass} + </if> + </select> + <select id="selectDetail" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select * from standard_product_list + where standard_method_list_id = #{standardMethodListId} + and state =#{state} + and model=#{model} + <if test="isCableTag != null and isCableTag != ''"> + and (inspection_item_class like concat('%缁撴瀯灏哄%') or + inspection_item_class like concat('%鐢电紗鐢垫�ц兘%')or + inspection_item_class like concat('%缁濈紭%')or + inspection_item_class like concat('%鐢电紗鐕冪儳鎬ц兘%')) + </if> + order by sort asc, + case when man_hour_group is NULL then 1 + when man_hour_group ='' then 1 else 0 end, + CASE + WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 濡傛灉浠ユ暟瀛楀紑澶达紝鍒欐寜鐓ф暟瀛楀ぇ灏忔帓搴� + WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 鎻愬彇瀛楁瘝鍚庨潰鐨勬暟瀛楅儴鍒� + ,id asc + </select> + <select id="selectDetail2" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select * from standard_product_list + where standard_method_list_id = #{standardMethodListId} + and state =#{state} + and tree =#{tree} + <if test="isCableTag != null and isCableTag != ''"> + and (inspection_item_class like concat('%缁撴瀯灏哄%') or + inspection_item_class like concat('%鐢电紗鐢垫�ц兘%')or + inspection_item_class like concat('%缁濈紭%')or + inspection_item_class like concat('%鐢电紗鐕冪儳鎬ц兘%')) + </if> + order by sort asc, + case when man_hour_group is NULL then 1 + when man_hour_group ='' then 1 else 0 end, + CASE + WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 濡傛灉浠ユ暟瀛楀紑澶达紝鍒欐寜鐓ф暟瀛楀ぇ灏忔帓搴� + WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 鎻愬彇瀛楁瘝鍚庨潰鐨勬暟瀛楅儴鍒� + ,id asc + </select> + <select id="selectPartColor" resultType="java.util.Map"> + select color, + color_code + from product_part + where part_no = #{partNo} + union all + select color, + color_code + from structure_test_object_part + where part_no = #{partNo} + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/StandardProductListSupplierAskMapper.xml b/basic-server/src/main/resources/mapper/StandardProductListSupplierAskMapper.xml new file mode 100644 index 0000000..9c9c6b1 --- /dev/null +++ b/basic-server/src/main/resources/mapper/StandardProductListSupplierAskMapper.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.ruoyi.basic.mapper.StandardProductListSupplierAskMapper"> + +</mapper> diff --git a/basic-server/src/main/resources/mapper/StandardTemplateMapper.xml b/basic-server/src/main/resources/mapper/StandardTemplateMapper.xml new file mode 100644 index 0000000..34a8b0e --- /dev/null +++ b/basic-server/src/main/resources/mapper/StandardTemplateMapper.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StandardTemplateMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardTemplate"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="name" column="name" jdbcType="VARCHAR"/> + <result property="remark" column="remark" jdbcType="VARCHAR"/> + <result property="thing" column="thing" jdbcType="VARCHAR"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + </resultMap> + + <select id="selectStandardTemplatePageList" resultType="com.ruoyi.basic.pojo.StandardTemplate"> + select * from ( + select st.id, st.name,st.number, st.remark, u2.name create_user_name, u3.name update_user_name, st.create_time, st.update_time + from standard_template st + left join user u2 on u2.id = st.create_user + left join user u3 on u3.id = st.update_user + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + <select id="getStandTempIdByName" resultType="com.ruoyi.basic.pojo.StandardTemplate"> + select id from standard_template where name=#{name} + </select> + <!-- 鏌ヨ鍘嬬缉鍚庣殑鏁版嵁 --> + <select id="selectCompressThing" resultType="java.lang.String"> + SELECT COMPRESS(thing) + from standard_template b + WHERE id = #{templateId} + </select> + + +</mapper> diff --git a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml new file mode 100644 index 0000000..74ded82 --- /dev/null +++ b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml @@ -0,0 +1,384 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StandardTreeMapper"> + <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardTree"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="factory" column="factory" jdbcType="VARCHAR"/> + <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> + <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> + <result property="sample" column="sample" jdbcType="VARCHAR"/> + <result property="model" column="model" jdbcType="VARCHAR"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + </resultMap> + + <resultMap id="FactoryDto" type="com.ruoyi.basic.dto.FactoryDto"> + <result property="label" column="factory"/> + <result property="value" column="factory"/> + <collection property="children" resultMap="LaboratoryDto"/> + </resultMap> + + <resultMap id="LaboratoryDto" type="com.ruoyi.basic.dto.LaboratoryDto"> + <result property="label" column="laboratory"/> + <result property="value" column="laboratory"/> + <collection property="children" resultMap="SampleTypeDto"/> + </resultMap> + + <resultMap id="SampleTypeDto" type="com.ruoyi.basic.dto.SampleTypeDto"> + <result property="label" column="sample_type"/> + <result property="value" column="sample_type"/> + <result property="sampleTypeId" column="sample_type_id"/> + <result property="sort" column="sort"/> + <result property="partNo" column="part_no"/> + <result property="sampleTypeEn" column="sample_type_en"/> + <collection property="children" resultMap="SampleDto"/> + </resultMap> + + <resultMap id="SampleDto" type="com.ruoyi.basic.dto.SampleDto"> + <result property="label" column="sample"/> + <result property="value" column="sample"/> + <result property="partNo" column="sample_part_no"/> + <result property="sampleEn" column="sample_en"/> + <collection property="children" resultMap="ModelDto"/> + </resultMap> + + <resultMap id="ModelDto" type="com.ruoyi.basic.dto.ModelDto"> + <result property="label" column="model"/> + <result property="value" column="model"/> + </resultMap> + + <sql id="selectStandardTree"> + sample sample2, + inspection_item, + inspection_item_en, + inspection_item_subclass, + inspection_item_subclass_en, + inspection_item_class, + inspection_item_class_en, + method, + son_laboratory, + unit, + ask_tell tell, + ask, + price, + man_hour, + man_hour_group, + man_day, + inspection_item_type, + inspection_value_type, + bsm, + template_id, + laboratory, + checkout_number, + section, + dic, + 0 state, + #{model} + model, + #{sample} + sample, + #{trees} + tree, + id + structure_item_parameter_id, + radius_list, + rates + </sql> + + <select id="selectStandardTreeList" resultMap="FactoryDto"> + select '涓ぉ绉戞妧妫�娴嬩腑蹇�' factory, + l.laboratory_name laboratory, + sto.specimen_name sample_type, + p.name sample, + st.model, + sto.code, + sto.id sample_type_id, + sto.sort, + sto.specimen_name_en sample_type_en, + p.name_en sample_en + 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.sample_type = sto.specimen_name + and st.sample = p.name + order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id + </select> + + <select id="selectStandardProductById" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select inspection_item, + inspection_item_subclass, + laboratory, + son_laboratory, + unit, + price, + man_hour, + man_hour_group, + inspection_item_type, + inspection_value_type, + checkout_number, + section, + method, + man_day, + bsm, + template_id + from structure_item_parameter + where id = #{id} + </select> + <select id="getStandardProductListBySample" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select inspection_item, + inspection_item_subclass, + laboratory, + son_laboratory, + unit, + price, + man_hour, + man_hour_group, + inspection_item_type, + inspection_value_type, + checkout_number, + section, + method, + man_day, + sample, + bsm, + template_id, + dic, + ask, + ask_tell as tell + from structure_item_parameter sp + where sp.sample = #{sampleType} + or sp.sample = '' + or sp.sample = '[]' + </select> + <select id="getStandardMethodListBySample" resultType="com.ruoyi.basic.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 is_use = 1 + and is_product = 1 + <if test="sampleType != null"> + and sto.specimen_name = #{sampleType} + </if> + </select> + <select id="selectStandardTreeList2" resultType="com.ruoyi.basic.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> + <select id="selectStandardProductListByTree" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select <include refid="selectStandardTree"/> + from structure_item_parameter + where ( + sample is NULL + OR sample = '' + or sample = '[]' + OR sample LIKE CONCAT('%[', #{tree}, ']%') + ) + and (laboratory is null + or laboratory = '' + or laboratory = #{laboratory}) + order by inspection_item_class, inspection_item, id asc + </select> + + <select id="selectStandardProductListByTree2" resultType="com.ruoyi.basic.pojo.StandardProductList"> + select <include refid="selectStandardTree"/> + from structure_item_parameter + where sample LIKE CONCAT('%[', #{tree}, ']%') + and (laboratory is null + or laboratory = '' + or laboratory = #{laboratory}) + order by inspection_item_class, inspection_item, id asc + </select> + + <select id="getStandardTree2" resultMap="SampleTypeDto"> + select sto.specimen_name sample_type, + p.name sample, + st.model + from structure_test_object sto + left join product p on p.object_id = sto.id + left join standard_tree st on st.sample_type = sto.specimen_name + and st.sample = p.name + </select> + + <select id="getStandardTree3" resultType="com.ruoyi.basic.dto.SampleDto"> + select model label, + model value + from standard_tree + where sample_type = #{sampleType} + and sample is null + </select> + + <select id="getLaboratory" resultType="java.lang.String"> + select l.laboratory_name + from structure_test_object sto + left join laboratory l on sto.laboratory_id = l.id + where sto.specimen_name = #{str} + </select> + <select id="getStructureItemParameterId" resultType="java.lang.Integer"> + select id from structure_item_parameter + where sample like concat('%', #{sampleType}, '%') + and inspection_item = #{item} + <if test="itemChild != null and itemChild != ''"> + and inspection_item_subclass = #{itemChild} + </if> + <if test="inspectionItemClass != null and inspectionItemClass != ''"> + and inspection_item_class = #{inspectionItemClass} + </if> + <if test="itemChild == null or itemChild == ''"> + and (inspection_item_subclass is null or inspection_item_subclass = '') + </if> + </select> + <select id="selectPList" resultType="com.ruoyi.basic.dto.ProductDto"> + select p.name + from structure_test_object sto + left join product p on p.object_id = sto.id + where sto.specimen_name = #{name} + order by p.id + </select> + <select id="selSample" resultType="java.lang.String"> + select name + from product + where name = #{name} + </select> + <select id="selectStandardTreeListByPartNo" resultMap="FactoryDto"> + select '涓ぉ绉戞妧妫�娴嬩腑蹇�' factory, + l.laboratory_name laboratory, + sto.specimen_name sample_type, + p.name sample, + st.model, + CASE + WHEN p.id = (SELECT pp.product_id + FROM product_part pp + WHERE pp.part_no = #{partNo}) + THEN #{partNo} + ELSE NULL + END AS sample_part_no, + CASE + WHEN sto.id = (SELECT sto.test_object_id + FROM structure_test_object_part sto + WHERE sto.part_no = #{partNo}) + THEN #{partNo} + ELSE NULL + END AS part_no + 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.sample_type = sto.specimen_name + and st.sample = p.name + where (p.id = (select pp.product_id + from product_part pp + where pp.part_no = #{partNo}) + or sto.id = (select sto.test_object_id + from structure_test_object_part sto + where sto.part_no = #{partNo})) + order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id + </select> + + <sql id="getIfsOrder"> + select * + from (SELECT ifs.*, + COALESCE(io1.create_user, io2.create_user) create_user, + COALESCE(io1.entrust_code, io2.entrust_code) entrust_code, + COALESCE(io1.send_time, io2.send_time) send_time, + io1.id enter_order_id, + ir1.id enter_report_id, + ir1.url enter_url, + ir1.url_s enter_url_s, + io2.id quarter_order_id, + ir2.id quarter_report_id, + ir2.url quarter_url, + ir2.url_s quarter_url_s, + group_concat(distinct isa.sample_code, ' ') sample_code, + group_concat(distinct isa.sample, ' ') sample_name, + group_concat(distinct isa.model, ' ') sample_model, + COALESCE(io1.state, io2.state) order_state, + COALESCE(isu.userName, COALESCE(u1.name, u2.name)) user_name, + group_concat(distinct iuh.unqualified_desc, ' ') unqualified_desc, + io1.is_exemption + FROM ifs_inventory_quantity ifs + LEFT JOIN ins_order io1 ON io1.ifs_inventory_id = ifs.id and io1.order_type = '杩涘巶妫�楠�' and io1.state != -1 + left join ins_report ir1 on io1.id = ir1.ins_order_id + left join user u1 on io1.create_user = u1.id + LEFT JOIN ins_order io2 ON io2.ifs_inventory_id = ifs.id and io2.order_type = 'Quarterly inspection' and io2.state != -1 + left join ins_report ir2 on io2.id = ir2.ins_order_id + left join user u2 on io2.create_user = u2.id + LEFT JOIN ins_sample isa ON COALESCE(io1.id, io2.id) = isa.ins_order_id + LEFT JOIN (SELECT ins_sample_id, GROUP_CONCAT(DISTINCT uu.name SEPARATOR ',') AS userName + FROM ins_sample_user u + LEFT JOIN user uu ON u.user_id = uu.id + WHERE u.state = 0 + GROUP BY ins_sample_id + ORDER BY ins_sample_id) isu ON isu.ins_sample_id = COALESCE(io1.id, io2.id) + left join ins_unqualified_handler iuh on iuh.inventory_quantity_id = ifs.id + group by ifs.id) a + </sql> + + <select id="getIfsByStateOne" resultType="com.ruoyi.basic.dto.IfsInventoryQuantityDto"> + <include refid="getIfsOrder"/> + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + + <select id="selectIfsPage" resultType="com.ruoyi.basic.pojo.IfsInventoryQuantity"> + SELECT * from ifs_inventory_quantity ifs + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + <select id="selectIfsInventoryQuantity" resultType="com.ruoyi.basic.dto.IfsInventoryQuantityCheckDto"> + SELECT * from ifs_inventory_quantity ifs + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + <select id="getIfsByOver" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> + select * from (<include refid="getIfsOrder"/> + <where> + <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''"> + send_time between #{beginDeclareDate} and #{endDeclareDate} + </if> + </where> + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + <select id="getIfsByOverList" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> + select * from (<include refid="getIfsOrder"/> + <where> + <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''"> + send_time between #{beginDeclareDate} and #{endDeclareDate} + </if> + </where> + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + <select id="getIfsByQuarter" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> + select * from (<include refid="getIfsOrder"/> + <where> + and (quarter_order_id is not null) + <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''"> + and send_time between #{beginDeclareDate} and #{endDeclareDate} + </if> + </where> + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> +</mapper> diff --git a/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml b/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml new file mode 100644 index 0000000..fd67dfc --- /dev/null +++ b/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StructureItemParameterMapper"> + <delete id="removeNoSample"> + delete + from structure_item_parameter + where sample like concat('%', #{sample}, '%') + </delete> + <select id="selectItemParameterList" resultType="com.ruoyi.basic.pojo.StructureItemParameter"> + select * from (select A.id, + inspection_item, + inspection_item_en, + inspection_item_subclass, + inspection_item_subclass_en, + laboratory, + unit, + price, + man_hour, + man_hour_group, + inspection_item_type, + checkout_number, + section, + A.create_user, + A.update_user, + A.create_time, + A.update_time, + method, + man_day, + bsm, + sample, + inspection_value_type, + dic, + template_id, + son_laboratory, + ask, + ask_tell, + inspection_item_class, + inspection_item_class_en, + code, + radius_list, + rates + from (select *, + CASE + WHEN INSTR(sample, ',') > 0 THEN + SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1) + when sample = '[""]' then null + when sample = '[]' then null + ELSE + TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1)) + END AS samples + from structure_item_parameter) A + left join structure_test_object sto on samples = specimen_name + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if>)B + order by CASE + WHEN code IS NULL THEN 1 + ELSE 0 + END, + CAST(code AS UNSIGNED), + case when man_hour_group is NULL then 1 + when man_hour_group ='' then 1 else 0 end, + CASE + WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 濡傛灉浠ユ暟瀛楀紑澶达紝鍒欐寜鐓ф暟瀛楀ぇ灏忔帓搴� + WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 鎻愬彇瀛楁瘝鍚庨潰鐨勬暟瀛楅儴鍒� + ,id asc + </select> + + <resultMap id="getInsProductions" type="map"> + <result property="name" column="sample"/> + <collection property="children" resultMap="itemClass" javaType="List"/> + </resultMap> + <resultMap id="itemClass" type="map"> + <result property="name" column="item_class"/> + <collection property="children" resultMap="item" javaType="List"/> + </resultMap> + <resultMap id="item" type="map"> + <result property="name" column="inspection_item"/> + <collection property="children" resultMap="itemSubClass" javaType="List"/> + </resultMap> + <resultMap id="itemSubClass" type="map"> + <id property="id" column="id"/> + <result property="name" column="subclass"/> + </resultMap> + <select id="getInsProduction" resultMap="getInsProductions"> + select distinct id, + CASE + WHEN INSTR(sample, ',') > 0 THEN + SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1) + when sample = '[""]' then '*' + ELSE + TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1)) + 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 + </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> + + <resultMap id="itemDto" type="com.ruoyi.basic.dto.TestItemDto"> + <result column="sId" property="id"/> + <result column="sName" property="name"/> + <collection property="children" resultMap="productDto"/> + </resultMap> + <resultMap id="productDto" type="com.ruoyi.basic.dto.ProductDto"> + <result column="pId" property="id"/> + <result column="pName" property="name"/> + </resultMap> +</mapper> diff --git a/basic-server/src/main/resources/mapper/StructureTestMapper.xml b/basic-server/src/main/resources/mapper/StructureTestMapper.xml new file mode 100644 index 0000000..05c7ae7 --- /dev/null +++ b/basic-server/src/main/resources/mapper/StructureTestMapper.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.basic.mapper.StructureTestObjectMapper"> + + <select id="selectTestObjectList" resultType="com.ruoyi.basic.dto.PageTestObjectDto"> + select * from ( + select sto.id, + sto.specimen_name, + u1.name create_user_name, + sto.create_time, + u2.name update_user_name, + sto.update_time, + sto.code, + sto.laboratory_id, + GROUP_CONCAT(p.name) product, + sto.specimen_name_en, + sto.object_type + from structure_test_object sto + left join user u1 on sto.create_user = u1.id + left join user u2 on sto.update_user = u2.id + left join product p on p.object_id = sto.id + left join product_part pp on pp.product_id = p.id + left join structure_test_object_part stop ON stop.test_object_id = sto.id + <if test="partNo != null and partNo != ''" > + where pp.part_no = #{partNo} or stop.part_no = #{partNo} + </if> + group by sto.id + ) a + <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> + ${ew.customSqlSegment} + </if> + </select> + +</mapper> diff --git a/basic-server/src/main/resources/mapper/StructureTestObjectPartMapper.xml b/basic-server/src/main/resources/mapper/StructureTestObjectPartMapper.xml new file mode 100644 index 0000000..ee26497 --- /dev/null +++ b/basic-server/src/main/resources/mapper/StructureTestObjectPartMapper.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.ruoyi.basic.mapper.StructureTestObjectPartMapper"> + <select id="selectListByTestObjectId" resultType="com.ruoyi.basic.pojo.StructureTestObjectPart"> + SELECT * from structure_test_object_part pp + where pp.test_object_id = #{testObjectId} + </select> +</mapper> diff --git a/inspect-server/pom.xml b/inspect-server/pom.xml new file mode 100644 index 0000000..0b3b4bc --- /dev/null +++ b/inspect-server/pom.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>ruoyi</artifactId> + <groupId>com.ruoyi</groupId> + <version>3.8.9</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>inspect-server</artifactId> + + <properties> + <maven.compiler.source>8</maven.compiler.source> + <maven.compiler.target>8</maven.compiler.target> + </properties> + +</project> diff --git a/inspect-server/src/main/java/com/ruoyi/basic/pojo/InsSample.java b/inspect-server/src/main/java/com/ruoyi/basic/pojo/InsSample.java new file mode 100644 index 0000000..fc15a45 --- /dev/null +++ b/inspect-server/src/main/java/com/ruoyi/basic/pojo/InsSample.java @@ -0,0 +1,123 @@ +package com.ruoyi.basic.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 妫�楠屾牱鍝� + * @TableName ins_sample + */ +@TableName(value ="ins_sample") +@Data +public class InsSample implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 1锛氬悎鏍� 0锛氫笉鍚堟牸 + */ + private Integer insResult; + + /** + * 澶栭敭锛歩ns_order琛╥d + */ + private Integer insOrderId; + + /** + * 閰嶅鏍峰搧鍨嬪彿 + */ + private String joinModel; + + /** + * 閰嶅鏍峰搧鍚嶇О + */ + private String joinName; + + /** + * 閰嶅鏍峰搧鏁伴噺 + */ + private Integer joinNum; + + /** + * 鏍峰搧缂栫爜 + */ + private String sampleCode; + + /** + * 妫�楠屽伐鍘� + */ + private String factory; + + /** + * 瀹為獙瀹ゅ悕绉� + */ + private String laboratory; + + /** + * 鏍峰搧绫诲瀷 + */ + private String sampleType; + + /** + * 鏍峰搧鍚嶇О + */ + private String sample; + + /** + * 瑙勬牸鍨嬪彿 + */ + private String model; + + /** + * 妫�楠岀姸鎬�(0锛氬緟妫�楠�1:妫�楠屼腑 2:宸叉楠�3锛氬緟澶嶆牳4锛氬鏍告湭閫氳繃5锛氬鏍搁�氳繃) + */ + private Integer insState; + + /** + * 澶囨敞 + */ + private String remark; + + private Integer standardMethodListId; + + @ApiModelProperty("鏍峰搧鍗曚綅") + private String unit; + + private Integer cellId; + + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty("鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty("淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + private Integer parentId; + + @ApiModelProperty("鏁伴噺") + private Integer quantity; + + @ApiModelProperty("鐗规畩鏍囧噯鏂规硶") + private String specialStandardMethod; + + @TableField(select = false,exist = false) + private Integer num=1; + +} diff --git a/pom.xml b/pom.xml index b2aed96..c3043d4 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,7 @@ <minio.version>8.4.3</minio.version> <okhttp.version>4.9.0</okhttp.version> <hutool.version>5.8.18</hutool.version> + <easyexcel.version>3.3.2</easyexcel.version> </properties> <!-- 渚濊禆澹版槑 --> @@ -226,6 +227,7 @@ <version>${ruoyi.version}</version> </dependency> + <!-- minio --> <dependency> <groupId>io.minio</groupId> @@ -254,6 +256,12 @@ <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> + </dependency> + + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>easyexcel</artifactId> + <version>${easyexcel.version}</version> </dependency> <!--mybatis-plus--> @@ -306,6 +314,12 @@ <artifactId>hutool-all</artifactId> <version>${hutool.version}</version> </dependency> + + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>fastjson</artifactId> + <version>2.0.23</version> + </dependency> </dependencies> <modules> @@ -315,6 +329,8 @@ <module>ruoyi-quartz</module> <module>ruoyi-generator</module> <module>ruoyi-common</module> + <module>basic-server</module> + <module>inspect-server</module> </modules> <packaging>pom</packaging> diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 9617d01..07b1109 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -43,6 +43,11 @@ <artifactId>mysql-connector-java</artifactId> </dependency> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>ruoyi-common</artifactId> + </dependency> + <!-- 鏍稿績妯″潡--> <dependency> <groupId>com.ruoyi</groupId> @@ -59,6 +64,20 @@ <dependency> <groupId>com.ruoyi</groupId> <artifactId>ruoyi-generator</artifactId> + </dependency> + + <!--鍩虹妯″潡--> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>basic-server</artifactId> + <version>${ruoyi.version}</version> + </dependency> + + <!--涓氬姟妯″潡--> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>inspect-server</artifactId> + <version>${ruoyi.version}</version> </dependency> </dependencies> @@ -80,17 +99,17 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>3.1.0</version> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>3.1.0</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <warName>${project.artifactId}</warName> - </configuration> - </plugin> + </configuration> + </plugin> </plugins> <finalName>${project.artifactId}</finalName> </build> -</project> \ No newline at end of file +</project> diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index a6fe9b7..d5d7042 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -135,6 +135,12 @@ <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> + <version>1.3</version> + </dependency> </dependencies> </project> diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/handler/MybatisHandler.java b/ruoyi-common/src/main/java/com/ruoyi/common/handler/MybatisHandler.java index e71bcaa..3f0d883 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/handler/MybatisHandler.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/handler/MybatisHandler.java @@ -1,6 +1,9 @@ package com.ruoyi.common.handler; +import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.ServletUtils; import org.apache.ibatis.reflection.MetaObject; import org.springframework.stereotype.Component; @@ -10,12 +13,26 @@ public class MybatisHandler implements MetaObjectHandler { @Override public void insertFill(MetaObject metaObject) { - this.setFieldValByName("createTime", LocalDateTime.now(), metaObject); - this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); + Integer userId = null; + try { + userId = SecurityUtils.getUserId().intValue(); + } catch (Exception ignored) { + } + System.out.println("鎵ц鎻掑叆濉厖..."); + this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now()); + this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); + this.strictInsertFill(metaObject, "createUser", Integer.class, userId); + this.strictInsertFill(metaObject, "updateUser", Integer.class, userId); } @Override public void updateFill(MetaObject metaObject) { - this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); + Integer userId = null; + try { + userId = SecurityUtils.getUserId().intValue(); + } catch (Exception ignored) { + } + this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); // 璧峰鐗堟湰 3.3.0(鎺ㄨ崘) + this.strictUpdateFill(metaObject, "updateUser", Integer.class, userId); } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/numgen/LambdaUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/LambdaUtils.java new file mode 100644 index 0000000..f8288ce --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/LambdaUtils.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2011-2020, baomidou (jobob@qq.com). + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * <p> + * https://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.ruoyi.common.numgen; + +import com.baomidou.mybatisplus.core.metadata.TableInfo; +import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.support.ColumnCache; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; + +import java.lang.ref.WeakReference; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + +import static java.util.Locale.ENGLISH; + +/** + * Lambda 瑙f瀽宸ュ叿绫� + * + * @author HCL, MieMie + * @since 2018-05-10 + */ +public final class LambdaUtils { + + /** + * 瀛楁鏄犲皠 + */ + private static final Map<String, Map<String, ColumnCache>> COLUMN_CACHE_MAP = new ConcurrentHashMap<>(); + + /** + * SerializedLambda 鍙嶅簭鍒楀寲缂撳瓨 + */ + private static final Map<String, WeakReference<SerializedLambda>> FUNC_CACHE = new ConcurrentHashMap<>(); + + /** + * 瑙f瀽 lambda 琛ㄨ揪寮�, 璇ユ柟娉曞彧鏄皟鐢ㄤ簡 {@link SerializedLambda#resolve(SFunction)} 涓殑鏂规硶锛屽湪姝ゅ熀纭�涓婂姞浜嗙紦瀛樸�� + * 璇ョ紦瀛樺彲鑳戒細鍦ㄤ换鎰忎笉瀹氱殑鏃堕棿琚竻闄� + * + * @param func 闇�瑕佽В鏋愮殑 lambda 瀵硅薄 + * @param <T> 绫诲瀷锛岃璋冪敤鐨� Function 瀵硅薄鐨勭洰鏍囩被鍨� + * @return 杩斿洖瑙f瀽鍚庣殑缁撴灉 + * @see SerializedLambda#resolve(SFunction) + */ + public static <T> SerializedLambda resolve(SFunction<T, ?> func) { + Class<?> clazz = func.getClass(); + String canonicalName = clazz.getCanonicalName(); + return Optional.ofNullable(FUNC_CACHE.get(canonicalName)) + .map(WeakReference::get) + .orElseGet(() -> { + SerializedLambda lambda = SerializedLambda.resolve(func); + FUNC_CACHE.put(canonicalName, new WeakReference<>(lambda)); + return lambda; + }); + } + + /** + * 鏍煎紡鍖� key 灏嗕紶鍏ョ殑 key 鍙樻洿涓哄ぇ鍐欐牸寮� + * + * <pre> + * Assert.assertEquals("USERID", formatKey("userId")) + * </pre> + * + * @param key key + * @return 澶у啓鐨� key + */ + public static String formatKey(String key) { + return key.toUpperCase(ENGLISH); + } + + /** + * 灏嗕紶鍏ョ殑琛ㄤ俊鎭姞鍏ョ紦瀛� + * + * @param tableInfo 琛ㄤ俊鎭� + */ + public static void installCache(TableInfo tableInfo) { + COLUMN_CACHE_MAP.put(tableInfo.getEntityType().getName(), createColumnCacheMap(tableInfo)); + } + + /** + * 缂撳瓨瀹炰綋瀛楁 MAP 淇℃伅 + * + * @param info 琛ㄤ俊鎭� + * @return 缂撳瓨 map + */ + private static Map<String, ColumnCache> createColumnCacheMap(TableInfo info) { + Map<String, ColumnCache> map = new HashMap<>(); + + String kp = info.getKeyProperty(); + if (StringUtils.isNotBlank(kp)) { + map.put(formatKey(kp), new ColumnCache(info.getKeyColumn(), info.getKeySqlSelect())); + } + + info.getFieldList().forEach(i -> + map.put(formatKey(i.getProperty()), new ColumnCache(i.getColumn(), i.getSqlSelect())) + ); + return map; + } + + /** + * 鑾峰彇瀹炰綋瀵瑰簲瀛楁 MAP + * + * @param clazz 瀹炰綋绫� + * @return 缂撳瓨 map + */ + public static Map<String, ColumnCache> getColumnMap(Class<?> clazz) { + return COLUMN_CACHE_MAP.computeIfAbsent(clazz.getName(), key -> { + TableInfo info = TableInfoHelper.getTableInfo(clazz); + return info == null ? null : createColumnCacheMap(info); + }); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGenerator.java b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGenerator.java new file mode 100644 index 0000000..3b933bb --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGenerator.java @@ -0,0 +1,146 @@ +package com.ruoyi.common.numgen; + +import com.baomidou.mybatisplus.core.metadata.TableFieldInfo; +import com.baomidou.mybatisplus.core.metadata.TableInfo; +import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.property.PropertyNamer; +import org.springframework.stereotype.Service; + +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * 缂栧彿鐢熸垚鍣� + * + * @Author: zhangxy + * @Date: 2020-09-08 16:31 + */ +@Slf4j +@Service +@AllArgsConstructor +public class NumberGenerator<T> { + + private static Pattern NUMBER_PATTERN = Pattern.compile("(.+)\\((\\d+)\\)"); + + private NumberGeneratorModelHelper numberGeneratorModelHelper; + + + public String getCopyValueOfUniqueField(final String value, SFunction<T, ?> column) { + if (value == null) { + return null; + } else { + Matcher matcher = NUMBER_PATTERN.matcher(value); + String oldValue = value; + int index = 1; + if (matcher.matches()) { + oldValue = matcher.group(1); + index = Integer.valueOf(matcher.group(2)) + 1; + } + + NumberTableInfo info = initDbInfo(column); + while (true) { + String newValue = oldValue + "(" + (index++) + ")"; + boolean exist = numberGeneratorModelHelper.numberExist(newValue, info); + if (!exist) { + return newValue; + } + } + } + } + + + /** + * 鐢熸垚缂栧彿 + * + * @param numOfDigits + * @param column + * @return + */ + public String generateNumber(final int numOfDigits, SFunction<T, ?> column) { + return generateNumberWithPrefix(numOfDigits, null, column); + } + + /** + * 鐢熸垚甯﹀墠缂�鐨勭紪鍙� + * + * @param numOfDigits + * @param prefix + * @param column + * @return + */ + public String generateNumberWithPrefix(final int numOfDigits, final String prefix, SFunction<T, ?> column) { + NumberTableInfo info = initDbInfo(column); + String generatedNumber = generateNumberWithExtension(info, numOfDigits, prefix, ""); + return prependPrefix(prefix, generatedNumber); + } + + + /** + * 鐢熸垚甯﹀悗缂�鐨勭紪鍙� + * + * @param numOfDigits + * @param suffix + * @param column + * @return + */ + public String generateNumberWithSuffix(final int numOfDigits, final String suffix, SFunction<T, ?> column) { + NumberTableInfo info = initDbInfo(column); + String generatedNumber = generateNumberWithExtension(info, numOfDigits, "", suffix); + return appendSuffix(suffix, generatedNumber); + } + + /** + * 鍒濆鍖栨暟鎹簱琛ㄥ悕銆佸瓧娈靛悕 + * + * @param column + * @return + */ + private NumberTableInfo initDbInfo(SFunction<T, ?> column) { + SerializedLambda ld = LambdaUtils.resolve(column); + TableInfo tableInfo = TableInfoHelper.getTableInfo(ld.getImplClass()); + String fieldName = PropertyNamer.methodToProperty(ld.getImplMethodName()); + Optional<TableFieldInfo> op = tableInfo.getFieldList().stream().filter(f -> fieldName.equals(f.getProperty())).findFirst(); + if (!op.isPresent()) { + throw new RuntimeException("鑾峰彇鏁版嵁搴撳瓧娈靛嚭閿欙紝璇锋鏌ユ槧灏�"); + } + TableFieldInfo fieldInfo = op.get(); + + NumberTableInfo info = new NumberTableInfo(); + info.setLogicDelete(tableInfo.isLogicDelete()); + info.setNumberFieldName(fieldInfo.getColumn()); + info.setTableName(tableInfo.getTableName()); + return info; + } + + + private String generateNumberWithExtension(NumberTableInfo numberTableInfo, int numOfDigits, String prefix, String suffix) { + Long dbMax = numberGeneratorModelHelper.getNumbersProjection(numberTableInfo, prefix, suffix); + Long greatestNumber = 0L; + if (dbMax != null) { + greatestNumber = dbMax; + } + return String.format("%0" + numOfDigits + "d", greatestNumber + 1); + } + + private String prependPrefix(final String prefix, final String generatedNumber) { + if (prefix == null) { + return generatedNumber; + } + return prefix + generatedNumber; + } + + + private String appendSuffix(final String suffix, final String generatedNumber) { + if (suffix == null) { + return generatedNumber; + } + return generatedNumber + suffix; + } + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGeneratorModelHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGeneratorModelHelper.java new file mode 100644 index 0000000..6b921b6 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGeneratorModelHelper.java @@ -0,0 +1,107 @@ +/** + * *************************************************************************** + * Copyright (c) 2010 Qcadoo Limited + * Project: Qcadoo Framework + * Version: 1.4 + * <p> + * This file is part of Qcadoo. + * <p> + * Qcadoo is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, + * or (at your option) any later version. + * <p> + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + * <p> + * You should have received a copy of the GNU Affero General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * *************************************************************************** + */ +package com.ruoyi.common.numgen; + +import com.google.common.collect.Maps; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @author zhangxy + */ +@AllArgsConstructor +@Service +public class NumberGeneratorModelHelper { + + private JdbcTemplate jdbcTemplate; + + + private static final String NUMBER_EXIST_QUERY_TEMPLATE = "select count(*) from ${TABLE_NAME} where ${NUMBER_FIELD}='${VALUE}'"; + + + private static final String GET_NUMBERS_QUERY_TEMPLATE = "select MAX( CAST( " + + " coalesce(TRIM(LEADING '0' from ${NUMBER_FIELD}), '0') " + + " AS UNSIGNED ) ) " + + "from ${TABLE_NAME} where 1=1"; + + private static final String GET_PREFIX_AWARE_NUMBERS_QUERY_TEMPLATE = "select MAX( CAST( " + + " TRIM(LEADING '0' from SUBSTRING(${NUMBER_FIELD}, ${NUMBER_STARTS_AT})) " + + " AS UNSIGNED ) ) " + + "from ${TABLE_NAME} where ${NUMBER_FIELD} like '${PREFIX}%'"; + + private static final String GET_SUFFIX_AWARE_NUMBERS_QUERY_TEMPLATE = "select MAX( CAST( " + + " TRIM(LEADING '0' from SUBSTRING(${NUMBER_FIELD}, 1, POSITION('${SUFFIX}' IN ${NUMBER_FIELD}) - 1)) " + + " AS UNSIGNED )) " + + "from ${TABLE_NAME} where ${NUMBER_FIELD} like '%${SUFFIX}'"; + + + public boolean numberExist(final String value, final NumberTableInfo numberTableInfo) { + Map<String, String> placeholderValues = Maps.newHashMap(); + + placeholderValues.put("TABLE_NAME", numberTableInfo.getTableName()); + placeholderValues.put("NUMBER_FIELD", numberTableInfo.getNumberFieldName()); + placeholderValues.put("VALUE", value); + String query = new StringSubstitutor(placeholderValues, "${", "}").replace(NUMBER_EXIST_QUERY_TEMPLATE); + Long count = jdbcTemplate.queryForObject(query, Long.class); + return count > 0; + } + + public Long getNumbersProjection(final NumberTableInfo numberTableInfo, final String prefix, final String suffix) { + String sqlQuery = buildQuery(numberTableInfo, prefix, suffix); + return jdbcTemplate.queryForObject(sqlQuery, Long.class); + } + + private String buildQuery(final NumberTableInfo numberTableInfo, + final String prefix, final String suffix) { + Map<String, String> placeholderValues = Maps.newHashMap(); + + placeholderValues.put("TABLE_NAME", numberTableInfo.getTableName()); + placeholderValues.put("NUMBER_FIELD", numberTableInfo.getNumberFieldName()); + + String query; + if (StringUtils.isNotEmpty(prefix)) { + placeholderValues.put("PREFIX", prefix); + int prefixLength = StringUtils.length(prefix); + placeholderValues.put("NUMBER_STARTS_AT", String.valueOf(prefixLength + 1)); + query = GET_PREFIX_AWARE_NUMBERS_QUERY_TEMPLATE; + } else if (StringUtils.isNotEmpty(suffix)) { + placeholderValues.put("SUFFIX", suffix); + query = GET_SUFFIX_AWARE_NUMBERS_QUERY_TEMPLATE; + } else { + query = GET_NUMBERS_QUERY_TEMPLATE; + } + + if(numberTableInfo.isLogicDelete()){ + query += " and active=true"; + } + StringSubstitutor substitutor = new StringSubstitutor(placeholderValues, "${", "}"); + return substitutor.replace(query); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberTableInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberTableInfo.java new file mode 100644 index 0000000..15c721f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberTableInfo.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.numgen; + +import lombok.Data; + +/** + * @Author: zhangxy + * @Date: 2020-09-11 16:48 + */ +@Data +public class NumberTableInfo { + + private String tableName; + private String numberFieldName; + + private boolean logicDelete; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/numgen/SerializedLambda.java b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/SerializedLambda.java new file mode 100644 index 0000000..49cdc30 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/numgen/SerializedLambda.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2011-2020, baomidou (jobob@qq.com). + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * <p> + * https://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.ruoyi.common.numgen; + +import com.baomidou.mybatisplus.core.toolkit.ClassUtils; +import com.baomidou.mybatisplus.core.toolkit.ExceptionUtils; +import com.baomidou.mybatisplus.core.toolkit.SerializationUtils; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; + +import java.io.*; + +/** + * 杩欎釜绫绘槸浠� {@link java.lang.invoke.SerializedLambda} 閲岄潰 copy 杩囨潵鐨勶紝 + * 瀛楁淇℃伅瀹屽叏涓�鏍� + * <p>璐熻矗灏嗕竴涓敮鎸佸簭鍒楃殑 Function 搴忓垪鍖栦负 SerializedLambda</p> + * + * @author HCL + * @since 2018/05/10 + */ +public class SerializedLambda implements Serializable { + + private static final long serialVersionUID = 8025925345765570181L; + + private Class<?> capturingClass; + private String functionalInterfaceClass; + private String functionalInterfaceMethodName; + private String functionalInterfaceMethodSignature; + private String implClass; + private String implMethodName; + private String implMethodSignature; + private int implMethodKind; + private String instantiatedMethodType; + private Object[] capturedArgs; + + /** + * 閫氳繃鍙嶅簭鍒楀寲杞崲 lambda 琛ㄨ揪寮忥紝璇ユ柟娉曞彧鑳藉簭鍒楀寲 lambda 琛ㄨ揪寮忥紝涓嶈兘搴忓垪鍖栨帴鍙e疄鐜版垨鑰呮甯搁潪 lambda 鍐欐硶鐨勫璞� + * + * @param lambda lambda瀵硅薄 + * @return 杩斿洖瑙f瀽鍚庣殑 SerializedLambda + */ + public static SerializedLambda resolve(SFunction<?, ?> lambda) { + if (!lambda.getClass().isSynthetic()) { + throw ExceptionUtils.mpe("璇ユ柟娉曚粎鑳戒紶鍏� lambda 琛ㄨ揪寮忎骇鐢熺殑鍚堟垚绫�"); + } + try (ObjectInputStream objIn = new ObjectInputStream(new ByteArrayInputStream(SerializationUtils.serialize(lambda))) { + @Override + protected Class<?> resolveClass(ObjectStreamClass objectStreamClass) throws IOException, ClassNotFoundException { + Class<?> clazz; + try { + clazz = ClassUtils.toClassConfident(objectStreamClass.getName()); + } catch (Exception ex) { + clazz = super.resolveClass(objectStreamClass); + } + return clazz == java.lang.invoke.SerializedLambda.class ? SerializedLambda.class : clazz; + } + }) { + return (SerializedLambda) objIn.readObject(); + } catch (ClassNotFoundException | IOException e) { + throw ExceptionUtils.mpe("This is impossible to happen", e); + } + } + + /** + * 鑾峰彇鎺ュ彛 class + * + * @return 杩斿洖 class 鍚嶇О + */ + public String getFunctionalInterfaceClassName() { + return normalizedName(functionalInterfaceClass); + } + + /** + * 鑾峰彇瀹炵幇鐨� class + * + * @return 瀹炵幇绫� + */ + public Class<?> getImplClass() { + return ClassUtils.toClassConfident(getImplClassName()); + } + + /** + * 鑾峰彇 class 鐨勫悕绉� + * + * @return 绫诲悕 + */ + public String getImplClassName() { + return normalizedName(implClass); + } + + /** + * 鑾峰彇瀹炵幇鑰呯殑鏂规硶鍚嶇О + * + * @return 鏂规硶鍚嶇О + */ + public String getImplMethodName() { + return implMethodName; + } + + /** + * 姝e父鍖栫被鍚嶇О锛屽皢绫诲悕绉颁腑鐨� / 鏇挎崲涓� . + * + * @param name 鍚嶇О + * @return 姝e父鐨勭被鍚� + */ + private String normalizedName(String name) { + return name.replace('/', '.'); + } + + /** + * @return 鑾峰彇瀹炰緥鍖栨柟娉曠殑绫诲瀷 + */ + public Class<?> getInstantiatedType() { + String instantiatedTypeName = normalizedName(instantiatedMethodType.substring(2, instantiatedMethodType.indexOf(';'))); + return ClassUtils.toClassConfident(instantiatedTypeName); + } + + /** + * @return 瀛楃涓插舰寮� + */ + @Override + public String toString() { + String interfaceName = getFunctionalInterfaceClassName(); + String implName = getImplClassName(); + return String.format("%s -> %s::%s", + interfaceName.substring(interfaceName.lastIndexOf('.') + 1), + implName.substring(implName.lastIndexOf('.') + 1), + implMethodName); + } + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBaseMapper.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBaseMapper.java new file mode 100644 index 0000000..e7b6391 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBaseMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.framework.mybatis_config; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** + * 鑷畾涔夋坊鍔爉ybatis-plus鎵归噺娣诲姞 + * @param <T> + */ +public interface MyBaseMapper <T> extends BaseMapper<T> { + + int insertBatchSomeColumn(List<T> entityList); +} + diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBatisPlusConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBatisPlusConfig.java new file mode 100644 index 0000000..6876062 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBatisPlusConfig.java @@ -0,0 +1,27 @@ +package com.ruoyi.framework.mybatis_config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + + +@Configuration +public class MyBatisPlusConfig { + + /** + * 闇�瑕侀厤缃嫤鎴櫒锛屼笉鐒跺湪AddDevice涓殑total鏃犳硶鑾峰彇鍒� + * @return + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor(){ + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 涔愯閿� + interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor()); + // 鍒嗛〉閰嶇疆 + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); + return interceptor; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MySqlInjector.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MySqlInjector.java new file mode 100644 index 0000000..e049473 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MySqlInjector.java @@ -0,0 +1,24 @@ +package com.ruoyi.framework.mybatis_config; + +import com.baomidou.mybatisplus.core.injector.AbstractMethod; +import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; +import com.baomidou.mybatisplus.core.metadata.TableInfo; +import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 鎵归噺娣诲姞 + */ +@Component +public class MySqlInjector extends DefaultSqlInjector { + + @Override + public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) { + List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo); + //澧炲姞鑷畾涔夋柟娉曪紝瀛楁娉ㄨВ涓婁笉绛変簬FieldFill.DEFAULT鐨勫瓧娈垫墠浼氭彃鍏� + methodList.add(new InsertBatchSomeColumn(t->!t.isLogicDelete())); + return methodList; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java index b88fc96..f5ebca7 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -1,6 +1,8 @@ package com.ruoyi.framework.web.exception; import javax.servlet.http.HttpServletRequest; + +import com.ruoyi.common.exception.DemoModeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.access.AccessDeniedException; @@ -14,7 +16,6 @@ import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.text.Convert; -import com.ruoyi.common.exception.DemoModeException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.html.EscapeUtil; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java index 5fb48fb..3e5cfb2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java @@ -1,18 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.common.core.domain.entity.SysDictType; /** * 瀛楀吀琛� 鏁版嵁灞� - * + * * @author ruoyi */ public interface SysDictTypeMapper { /** * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀绫诲瀷 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 */ @@ -20,14 +23,14 @@ /** * 鏍规嵁鎵�鏈夊瓧鍏哥被鍨� - * + * * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 */ public List<SysDictType> selectDictTypeAll(); /** * 鏍规嵁瀛楀吀绫诲瀷ID鏌ヨ淇℃伅 - * + * * @param dictId 瀛楀吀绫诲瀷ID * @return 瀛楀吀绫诲瀷 */ @@ -35,7 +38,7 @@ /** * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 瀛楀吀绫诲瀷 */ @@ -43,7 +46,7 @@ /** * 閫氳繃瀛楀吀ID鍒犻櫎瀛楀吀淇℃伅 - * + * * @param dictId 瀛楀吀ID * @return 缁撴灉 */ @@ -51,7 +54,7 @@ /** * 鎵归噺鍒犻櫎瀛楀吀绫诲瀷淇℃伅 - * + * * @param dictIds 闇�瑕佸垹闄ょ殑瀛楀吀ID * @return 缁撴灉 */ @@ -59,7 +62,7 @@ /** * 鏂板瀛楀吀绫诲瀷淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 缁撴灉 */ @@ -67,7 +70,7 @@ /** * 淇敼瀛楀吀绫诲瀷淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 缁撴灉 */ @@ -75,9 +78,11 @@ /** * 鏍¢獙瀛楀吀绫诲瀷绉版槸鍚﹀敮涓� - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 缁撴灉 */ public SysDictType checkDictTypeUnique(String dictType); + + List<SysDictType> selectList(String dictName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index 01c1c1d..10e27a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -6,14 +6,14 @@ /** * 瀛楀吀 涓氬姟灞� - * + * * @author ruoyi */ public interface ISysDictTypeService { /** * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀绫诲瀷 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 */ @@ -21,22 +21,30 @@ /** * 鏍规嵁鎵�鏈夊瓧鍏哥被鍨� - * + * * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 */ public List<SysDictType> selectDictTypeAll(); /** * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁 - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 */ public List<SysDictData> selectDictDataByType(String dictType); /** + * 鏍规嵁瀛楀吀鍚嶇О鏌ヨ瀛楀吀鏁版嵁 + * + * @param dictName 瀛楀吀鍚嶇О + * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 + */ + public List<SysDictData> selectDictDataByName(String dictName); + + /** * 鏍规嵁瀛楀吀绫诲瀷ID鏌ヨ淇℃伅 - * + * * @param dictId 瀛楀吀绫诲瀷ID * @return 瀛楀吀绫诲瀷 */ @@ -44,7 +52,7 @@ /** * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 瀛楀吀绫诲瀷 */ @@ -52,7 +60,7 @@ /** * 鎵归噺鍒犻櫎瀛楀吀淇℃伅 - * + * * @param dictIds 闇�瑕佸垹闄ょ殑瀛楀吀ID */ public void deleteDictTypeByIds(Long[] dictIds); @@ -74,7 +82,7 @@ /** * 鏂板淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 缁撴灉 */ @@ -82,7 +90,7 @@ /** * 淇敼淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 缁撴灉 */ @@ -90,7 +98,7 @@ /** * 鏍¢獙瀛楀吀绫诲瀷绉版槸鍚﹀敮涓� - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 缁撴灉 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index 7fd9654..05c999f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -5,6 +5,8 @@ import java.util.Map; import java.util.stream.Collectors; import javax.annotation.PostConstruct; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -20,7 +22,7 @@ /** * 瀛楀吀 涓氬姟灞傚鐞� - * + * * @author ruoyi */ @Service @@ -43,7 +45,7 @@ /** * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀绫诲瀷 - * + * * @param dictType 瀛楀吀绫诲瀷淇℃伅 * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 */ @@ -55,7 +57,7 @@ /** * 鏍规嵁鎵�鏈夊瓧鍏哥被鍨� - * + * * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 */ @Override @@ -66,7 +68,7 @@ /** * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁 - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 */ @@ -88,8 +90,21 @@ } /** + * 鏍规嵁瀛楀吀鍚嶇О鏌ヨ瀛楀吀鏁版嵁 + * + * @param dictName 瀛楀吀鍚嶇О + * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 + */ + @Override + public List<SysDictData> selectDictDataByName(String dictName) + { + List<SysDictType> sysDictTypes = dictTypeMapper.selectList(dictName); + return selectDictDataByType(sysDictTypes.get(0).getDictType()); + } + + /** * 鏍规嵁瀛楀吀绫诲瀷ID鏌ヨ淇℃伅 - * + * * @param dictId 瀛楀吀绫诲瀷ID * @return 瀛楀吀绫诲瀷 */ @@ -101,7 +116,7 @@ /** * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ淇℃伅 - * + * * @param dictType 瀛楀吀绫诲瀷 * @return 瀛楀吀绫诲瀷 */ @@ -113,7 +128,7 @@ /** * 鎵归噺鍒犻櫎瀛楀吀绫诲瀷淇℃伅 - * + * * @param dictIds 闇�瑕佸垹闄ょ殑瀛楀吀ID */ @Override @@ -167,7 +182,7 @@ /** * 鏂板淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * + * * @param dict 瀛楀吀绫诲瀷淇℃伅 * @return 缁撴灉 */ @@ -184,7 +199,7 @@ /** * 淇敼淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * + * * @param dict 瀛楀吀绫诲瀷淇℃伅 * @return 缁撴灉 */ @@ -205,7 +220,7 @@ /** * 鏍¢獙瀛楀吀绫诲瀷绉版槸鍚﹀敮涓� - * + * * @param dict 瀛楀吀绫诲瀷 * @return 缁撴灉 */ diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index 438d484..5288fa9 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -1,105 +1,143 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.system.mapper.SysDictTypeMapper"> + <resultMap type="SysDictType" id="SysDictTypeResult"> + <id property="dictId" column="dict_id"/> + <result property="dictName" column="dict_name"/> + <result property="dictType" column="dict_type"/> + <result property="status" column="status"/> + <result property="createBy" column="create_by"/> + <result property="createTime" column="create_time"/> + <result property="updateBy" column="update_by"/> + <result property="updateTime" column="update_time"/> + </resultMap> - <resultMap type="SysDictType" id="SysDictTypeResult"> - <id property="dictId" column="dict_id" /> - <result property="dictName" column="dict_name" /> - <result property="dictType" column="dict_type" /> - <result property="status" column="status" /> - <result property="createBy" column="create_by" /> - <result property="createTime" column="create_time" /> - <result property="updateBy" column="update_by" /> - <result property="updateTime" column="update_time" /> - </resultMap> - - <sql id="selectDictTypeVo"> - select dict_id, dict_name, dict_type, status, create_by, create_time, remark - from sys_dict_type + <sql id="selectDictTypeVo"> + select dict_id, dict_name, dict_type, status, create_by, create_time, remark + from sys_dict_type </sql> - <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - <where> - <if test="dictName != null and dictName != ''"> - AND dict_name like concat('%', #{dictName}, '%') - </if> - <if test="status != null and status != ''"> - AND status = #{status} - </if> - <if test="dictType != null and dictType != ''"> - AND dict_type like concat('%', #{dictType}, '%') - </if> - <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� --> - and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') - </if> - <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� --> - and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') - </if> - </where> - </select> - - <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - </select> - - <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - where dict_id = #{dictId} - </select> - - <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - where dict_type = #{dictType} - </select> - - <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - where dict_type = #{dictType} limit 1 - </select> - - <delete id="deleteDictTypeById" parameterType="Long"> - delete from sys_dict_type where dict_id = #{dictId} - </delete> - - <delete id="deleteDictTypeByIds" parameterType="Long"> - delete from sys_dict_type where dict_id in - <foreach collection="array" item="dictId" open="(" separator="," close=")"> - #{dictId} - </foreach> - </delete> + <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + <where> + <if test="dictName != null and dictName != ''"> + AND dict_name like concat('%', #{dictName}, '%') + </if> + <if test="status != null and status != ''"> + AND status = #{status} + </if> + <if test="dictType != null and dictType != ''"> + AND dict_type like concat('%', #{dictType}, '%') + </if> + <if test="params.beginTime != null and params.beginTime != ''"> + <!-- 寮�濮嬫椂闂存绱� --> + and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') + </if> + <if test="params.endTime != null and params.endTime != ''"> + <!-- 缁撴潫鏃堕棿妫�绱� --> + and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') + </if> + </where> + </select> - <update id="updateDictType" parameterType="SysDictType"> - update sys_dict_type - <set> - <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> - <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> - <if test="status != null">status = #{status},</if> - <if test="remark != null">remark = #{remark},</if> - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> - update_time = sysdate() - </set> - where dict_id = #{dictId} - </update> - - <insert id="insertDictType" parameterType="SysDictType"> - insert into sys_dict_type( - <if test="dictName != null and dictName != ''">dict_name,</if> - <if test="dictType != null and dictType != ''">dict_type,</if> - <if test="status != null">status,</if> - <if test="remark != null and remark != ''">remark,</if> - <if test="createBy != null and createBy != ''">create_by,</if> - create_time - )values( - <if test="dictName != null and dictName != ''">#{dictName},</if> - <if test="dictType != null and dictType != ''">#{dictType},</if> - <if test="status != null">#{status},</if> - <if test="remark != null and remark != ''">#{remark},</if> - <if test="createBy != null and createBy != ''">#{createBy},</if> - sysdate() - ) - </insert> - -</mapper> \ No newline at end of file + <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + </select> + + <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + where dict_id = #{dictId} + </select> + + <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + where dict_type = #{dictType} + </select> + + <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + where dict_type = #{dictType} limit 1 + </select> + + <delete id="deleteDictTypeById" parameterType="Long"> + delete + from sys_dict_type + where dict_id = #{dictId} + </delete> + + <delete id="deleteDictTypeByIds" parameterType="Long"> + delete from sys_dict_type where dict_id in + <foreach collection="array" item="dictId" open="(" separator="," close=")"> + #{dictId} + </foreach> + </delete> + + <update id="updateDictType" parameterType="SysDictType"> + update sys_dict_type + <set> + <if test="dictName != null and dictName != ''"> + dict_name = #{dictName}, + </if> + <if test="dictType != null and dictType != ''"> + dict_type = #{dictType}, + </if> + <if test="status != null"> + status = #{status}, + </if> + <if test="remark != null"> + remark = #{remark}, + </if> + <if test="updateBy != null and updateBy != ''"> + update_by = #{updateBy}, + </if> + update_time = sysdate() + </set> + where dict_id = #{dictId} + </update> + + <insert id="insertDictType" parameterType="SysDictType"> + insert into sys_dict_type( + <if test="dictName != null and dictName != ''"> + dict_name, + </if> + <if test="dictType != null and dictType != ''"> + dict_type, + </if> + <if test="status != null"> + status, + </if> + <if test="remark != null and remark != ''"> + remark, + </if> + <if test="createBy != null and createBy != ''"> + create_by, + </if> + create_time + )values( + <if test="dictName != null and dictName != ''"> + #{dictName}, + </if> + <if test="dictType != null and dictType != ''"> + #{dictType}, + </if> + <if test="status != null"> + #{status}, + </if> + <if test="remark != null and remark != ''"> + #{remark}, + </if> + <if test="createBy != null and createBy != ''"> + #{createBy}, + </if> + sysdate() + ) + </insert> + + <select id="selectList" resultType="com.ruoyi.common.core.domain.entity.SysDictType"> + select * + from sys_dict_type + where dict_name = #{dictName} + </select> +</mapper> -- Gitblit v1.9.3