XiaoRuby
2023-07-25 653cbd6bc42565dbdcc7fdbe652874738b1908df
LIMS管理系统框架-开发7-25标准库修改前
已修改46个文件
已重命名2个文件
已删除4个文件
已添加10个文件
1788 ■■■■ 文件已修改
framework/src/main/java/com/yuanchu/limslaboratory/config/WebMvcConfig.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/limslaboratory/exception/MyFileException.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/limslaboratory/handler/GlobalExceptionHandler.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/limslaboratory/utils/FileSaveUtil.java 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/InspectionMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/InspectionMaterialList.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/InspectionDto.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/InspectionService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/InspectionMapper.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/ClassifyController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/EquipmentPointController.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/InstrumentController.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/MetricalInformationController.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/Classify.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/EquipmentPoint.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/Instrument.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/MetricalInformation.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/ClassifyMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/EquipmentPointMapper.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/InstrumentMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/MetricalInformationMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/Classify.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/EquipmentPoint.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/Instrument.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/MetricalInformation.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateClassifyDto.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateEquipmentPointDto.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateInstrumentDto.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateMetricalInformationDto.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/ClassifyService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/EquipmentPointService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/InstrumentService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/MetricalInformationService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ClassifyServiceImpl.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/EquipmentPointServiceImpl.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InstrumentServiceImpl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MetricalInformationServiceImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/resources/mapper/EquipmentPointMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/resources/mapper/MetricalInformationMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateMaterialInformation.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpeStateSpecificationsDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpecificationsInformationDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SpecificationsService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/SpecificationsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/java/com/yuanchu/limslaboratory/CodeGenerator.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application-dev.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application-prod.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/limslaboratory/config/WebMvcConfig.java
@@ -19,7 +19,6 @@
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
        //设置文件虚拟路径映射
        registry.addResourceHandler("/img/**").addResourceLocations("file:"+filePath+"/")
                .addResourceLocations("file:"+filePath+"/");
        registry.addResourceHandler("/img/**").addResourceLocations("file:"+filePath+"/");
    }
}
framework/src/main/java/com/yuanchu/limslaboratory/exception/MyFileException.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package com.yuanchu.limslaboratory.exception;
public class MyFileException extends RuntimeException{
    public MyFileException() {
    }
    public MyFileException(String message) {
        super(message);
    }
    public MyFileException(Throwable cause) {
        super(cause);
    }
    public MyFileException(String message, Throwable cause) {
        super(message, cause);
    }
}
framework/src/main/java/com/yuanchu/limslaboratory/handler/GlobalExceptionHandler.java
@@ -1,16 +1,22 @@
package com.yuanchu.limslaboratory.handler;
import com.yuanchu.limslaboratory.exception.MyFileException;
import com.yuanchu.limslaboratory.utils.MyUtil;
import com.yuanchu.limslaboratory.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException;
import org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException;
import org.springframework.beans.ConversionNotSupportedException;
import org.springframework.beans.TypeMismatchException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.http.converter.HttpMessageNotWritableException;
import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MultipartException;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -20,6 +26,13 @@
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
    @Value("${spring.servlet.multipart.max-file-size}")
    private String maxFileSize;
    @Value("${spring.servlet.multipart.max-request-size}")
    private String maxRequestSize;
    @ExceptionHandler(SQLException.class)
    public Result<?> handlerSQLException(SQLException e)
    {
@@ -155,6 +168,29 @@
        return Result.fail("除数不能为0异常");
    }
    /**
     *文件过大报错提示
     */
    @ExceptionHandler({MultipartException.class})
    public Result<?> fileUploadExceptionHandler(MultipartException  e) {
        String msg;
        Throwable rootCause = e.getRootCause();
        if (rootCause instanceof FileSizeLimitExceededException) {
            msg="上传文件过大【单个文件大小不得超过" + maxFileSize + "】";
        }else if(rootCause instanceof SizeLimitExceededException){
            msg="上传文件过大【总上传大小不得超过" + maxRequestSize + "】";
        }else {
            msg="文件上传失败【服务器异常】";
        }
        return Result.fail(msg);
    }
    /** æ–‡ä»¶åŽç¼€åä¸é€šè¿‡è¿”回提示 */
    @ExceptionHandler({MyFileException.class})
    public Result<?> myFileException(Exception e) {
        return Result.fail("抱歉不支持【" + e.getMessage() +"】后缀的文件!");
    }
    /** å…¶ä»–错误 */
    @ExceptionHandler({Exception.class})
    public Result<?> exception(Exception e) {
framework/src/main/java/com/yuanchu/limslaboratory/utils/FileSaveUtil.java
@@ -1,10 +1,16 @@
package com.yuanchu.limslaboratory.utils;
import com.yuanchu.limslaboratory.exception.MyFileException;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.FileSystemUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -16,32 +22,62 @@
public class FileSaveUtil {
    // å–yml中的路径 + /
//    @Value("${file.path}")
    private String FILE_PATH;
    private static String FILE_PATH;
    private static String[] ALLOWED;
    @Value("${file.path}")
    private String file;
    @Value("${file.allowed}")
    private String[] allowed;
    @PostConstruct
    public void getFile() {
        FILE_PATH = this.file;
    }
    @PostConstruct
    public void getAllowed(){
        ALLOWED = this.allowed;
    }
    /**
     * å­˜å‚¨æ–‡ä»¶ä¸»å‡½æ•°
     * @param content æ–‡ä»¶äºŒè¿›åˆ¶æµ
     * @param originalFilename æ–‡ä»¶åç§°
     * @param file æ–‡ä»¶äºŒè¿›åˆ¶æµ
     * @return è¿”回文件名称用于存储数据库
     */
    public String StoreFile(byte[] content, String originalFilename) {
    public static String StoreFile(MultipartFile file) {
        String originalFilename = file.getOriginalFilename();
        // ç”Ÿæˆéšæœºåç§°ï¼šæ—¶é—´_随机6位数字
        String FileName = System.currentTimeMillis() + "_" + MyUtil.getNumber(6);
        String suffix = originalFilename.substring(originalFilename.lastIndexOf("."));
        String suffix = null;
        if (originalFilename != null) {
            suffix = originalFilename.substring(originalFilename.lastIndexOf("."));
            // å¦‚果后缀名不通过抛出异常
            if (!isFileAllowed(suffix)){
                throw  new MyFileException(suffix);
            }
        }
        // åç§°æ‹¼æŽ¥
        String fileName = FileName + suffix;
        // è¿›è¡Œå­˜å‚¨
        storeFileWithFileName(content, fileName);
        try {
            storeFileWithFileName(file.getBytes(), fileName);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return fileName;
    }
    public static Boolean DeleteFile(String fileName) {
        return FileSystemUtils.deleteRecursively(new File(FILE_PATH + "/" + fileName));
    }
    /**
     * å­˜å‚¨æ–‡ä»¶å‡½æ•°
     * @param content æ–‡ä»¶äºŒè¿›åˆ¶æµ
     * @param fileName æ–‡ä»¶åç§°
     */
    private void storeFileWithFileName(byte[] content, String fileName) {
    private static void storeFileWithFileName(byte[] content, String fileName) {
        // å­˜å‚¨è·¯å¾„
        String path = FILE_PATH + java.io.File.separatorChar;
        // ç›®å½•不存在则创建
@@ -57,4 +93,21 @@
            MyUtil.PrintLog("存储文件异常:" + e);
        }
    }
    /**
     * åˆ¤æ–­æ–‡ä»¶æ˜¯å¦è¢«å…è®¸ä¸Šä¼ 
     *
     * @param fileName æ–‡ä»¶å
     * @return å…è®¸true, å¦åˆ™false
     */
    private static boolean isFileAllowed(String fileName) {
        // èŽ·å–åŽç¼€å
        String suffixName = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
        for (String allow : ALLOWED) {
            if (allow.equals(suffixName)) {
                return true;
            }
        }
        return false;
    }
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/InspectionMapper.java
@@ -19,4 +19,6 @@
    List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state);
    int selectInspectToCount(Integer state);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/InspectionMaterialList.java
@@ -27,7 +27,7 @@
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id", hidden = true)
    private int id;
    private Integer id;
    @ApiModelProperty(value = "materialId")
    private String materialId;
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/InspectionDto.java
@@ -1,11 +1,18 @@
package com.yuanchu.limslaboratory.pojo.dto;
import com.yuanchu.limslaboratory.pojo.Inspection;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="InspectionDto检验单对象", description="")
public class InspectionDto extends Inspection implements Serializable {
    private static final long serialVersionUID = 1L;
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/InspectionService.java
@@ -19,9 +19,10 @@
    Inspection addInspection(String userName,int type);
    List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state);
    Map selectAllInspection(int pageSize, int countSize, Integer state);
    boolean delInspectionByInsId(String inspectionId);
    boolean subInspectionByInsId(String inspectionId);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
@@ -12,6 +12,7 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -39,8 +40,11 @@
    }
    @Override
    public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) {
        return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state);
    public Map selectAllInspection(int pageSize, int countSize, Integer state) {
        Map map = new HashMap();
        map.put("data",inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state));
        map.put("count", inspectionMapper.selectInspectToCount(state));
        return map;
    }
    @Override
inspection-server/src/main/resources/mapper/InspectionMapper.xml
@@ -1,8 +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.yuanchu.limslaboratory.mapper.InspectionMapper">
    <select id="selectAllInspection" resultType="InspectionDto">
        select i.id, type, inspection_status, qualified_state, i.state, i.create_time, user_name, inspect_user_id, inspect_start_time, inspect_end_time, u.name inspectUserName
    <select id="selectAllInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionDto">
        select i.id, type, inspection_status, qualified_state, i.create_time, user_name, inspect_start_time, inspect_end_time, u.name inspectUserName
        from inspection i left join user u
        on i.inspect_user_id = u.id
        <if test="state!=null">
@@ -11,4 +11,13 @@
        order by i.create_time desc
        limit #{pageSize},#{countSize}
    </select>
    <select id="selectInspectToCount" resultType="java.lang.Integer">
        select count(*)
        from inspection i left join user u
        on i.inspect_user_id = u.id
        <if test="state!=null">
            where state = #{state}
        </if>
    </select>
</mapper>
laboratory-server/pom.xml
@@ -20,5 +20,11 @@
            <artifactId>framework</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yunchu.limslaboratory</groupId>
            <artifactId>user-server</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
    </dependencies>
</project>
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/ClassifyController.java
@@ -1,9 +1,19 @@
package com.yuanchu.limslaboratory.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yuanchu.limslaboratory.pojo.Classify;
import com.yuanchu.limslaboratory.pojo.dto.UpdateClassifyDto;
import com.yuanchu.limslaboratory.service.ClassifyService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.MyUtil;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
@@ -13,8 +23,64 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Api(tags = "实验室-->设备台账-->1、分类模块")
@RestController
@RequestMapping("/classify")
public class ClassifyController {
    @Autowired
    private ClassifyService classifyService;
    @ApiOperation("添加分类:如果选择了name即添加的为子节点数据;如果没有选择即添加的为父节点数据;后台处理")
    @PostMapping("/add")
    public Result<?> addClassifyInformation(@RequestBody Classify classify) {
        if (ObjectUtils.isEmpty(classify.getSonName())){
            return Result.fail("请填写分类名称!");
        }
        Integer isAddClassifySuccess = classifyService.addClassifyInformation(classify);
        if (isAddClassifySuccess == 1) {
            if (ObjectUtils.isEmpty(classify.getSonName())){
                return Result.success("添加父级【"+ classify.getFatherName() +"】分类成功!");
            }
            return Result.success("添加分类【"+ classify.getSonName() +"】成功!");
        } else if (isAddClassifySuccess == 2){
            return Result.fail("抱歉重复添加父级【"+ classify.getFatherName() +"】分类,添加失败!");
        } else if (isAddClassifySuccess == 3) {
            return Result.fail("抱歉重复添加子级【"+ classify.getSonName() +"】,添加失败!");
        }
        return Result.fail("添加分类【"+ classify.getSonName() +"】失败!");
    }
    @ApiOperation("分类侧边栏列表:如果sonName为空,则带着father_name的Id进行点击操作")
    @GetMapping("/list")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "分类名称", name = "classifyName", dataTypeClass = String.class)
    })
    public Result<?> getListClassifyInformation(String classifyName) {
        return Result.success(classifyService.getListClassifyInformation(classifyName));
    }
    @ApiOperation("删除分类")
    @DeleteMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "分类Id", name = "classifyId", dataTypeClass = String.class)
    })
    public Result<?> deleteClassifyInformation(String classifyId) {
        Boolean isDeleteSuccess = classifyService.deleteClassifyInformation(classifyId);
        if (isDeleteSuccess){
            return Result.success("删除分类成功!");
        }
        return Result.fail("删除分类失败!");
    }
    @ApiOperation("更新分类")
    @PutMapping("/update")
    public Result<?> updateClassifyInformation(@RequestBody UpdateClassifyDto updateClassifyDto) throws Exception {
        Classify classify = JackSonUtil.unmarshal(JackSonUtil.marshal(updateClassifyDto), Classify.class);
        Boolean isUpdateClassifySuccess = classifyService.updateClassifyInformation(classify);
        if (isUpdateClassifySuccess){
            return Result.success("更新分类成功!");
        }
        return Result.fail("更新分类失败!");
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/EquipmentPointController.java
@@ -1,9 +1,26 @@
package com.yuanchu.limslaboratory.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.EquipmentPoint;
import com.yuanchu.limslaboratory.pojo.dto.UpdateEquipmentPointDto;
import com.yuanchu.limslaboratory.service.EquipmentPointService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.MyUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -13,8 +30,58 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Api(tags = "实验室-->设备台账-->3、设备码点")
@RestController
@RequestMapping("/equipment-point")
public class EquipmentPointController {
    @Autowired
    private EquipmentPointService equipmentPointService;
    @ApiOperation("添加设备码点")
    @PostMapping("/add")
    public Result<?> addEquipmentPointInformation(@RequestHeader("X-Token") String token, @RequestBody EquipmentPoint equipmentPoint) throws Exception {
        Object object = RedisUtil.get(token);
        Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
        equipmentPoint.setUserId((Integer) unmarshal.get("id"));
        Integer isInsertSuccess = equipmentPointService.addEquipmentPointInformation(equipmentPoint);
        if (isInsertSuccess == 1){
            return Result.success("添加【"+ equipmentPoint.getEquipmentPointName() +"】成功!");
        }
        return Result.fail("添加【"+ equipmentPoint.getEquipmentPointName() +"】失败!设备码点编码重复!");
    }
    @ApiOperation("查询所有设备码点数据")
    @GetMapping("/list")
    public Result<?> getListEquipmentPointInformation() {
        List<Map<String, Object>> list = equipmentPointService.getListEquipmentPointInformation();
        return Result.success(list);
    }
    @ApiOperation("根据码点Id删除数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "equipmentPointId", value = "设备码点Id", dataTypeClass = Integer.class, required = true)
    })
    @DeleteMapping("/delete")
    public Result<?> deleteEquipmentPointInformation(Integer equipmentPointId) {
        Integer isDeleteSuccess = equipmentPointService.deleteEquipmentPointInformation(equipmentPointId);
        if (isDeleteSuccess == 1){
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
    @ApiOperation("根据码点Id更新数据")
    @PutMapping("/update")
    public Result<?> updateEquipmentPointInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateEquipmentPointDto updateEquipmentPointDto) throws Exception {
        Object object = RedisUtil.get(token);
        Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
        EquipmentPoint equipmentPoint = JackSonUtil.unmarshal(JackSonUtil.marshal(updateEquipmentPointDto), EquipmentPoint.class);
        equipmentPoint.setUserId((Integer) unmarshal.get("id"));
        Integer isUpdateSuccess = equipmentPointService.updateEquipmentPointInformation(equipmentPoint);
        if (isUpdateSuccess == 1){
            return Result.success("更新成功!");
        }
        return Result.fail("更新失败!");
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/InstrumentController.java
@@ -1,9 +1,24 @@
package com.yuanchu.limslaboratory.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.pojo.dto.UpdateInstrumentDto;
import com.yuanchu.limslaboratory.service.InstrumentService;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -13,8 +28,88 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Api(tags = "实验室-->设备台账-->2、仪器模块")
@RestController
@RequestMapping("/instrument")
public class InstrumentController {
    @Autowired
    private InstrumentService instrumentService;
    @Autowired
    private UserService userService;
    @ApiOperation("添加仪器设备")
    @PostMapping("/add")
    public Result<?> addInstrumentInformation(@RequestBody Instrument instrument) {
        Integer isInsertSuccess = instrumentService.addInstrumentInformation(instrument);
        if (isInsertSuccess == 1){
            return Result.success("添加【" + instrument.getEquipmentName() + "】成功!");
        }
        return Result.fail("仪器设备编号重复,添加【" + instrument.getEquipmentName() + "】失败! ");
    }
    @ApiOperation("根据分类Id:分页列表展示")
    @GetMapping("/list")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "classifyId", value = "分类Id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "conditions", value = "查询状态:默认全部", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "whetherWhether", value = "是否已过期", dataTypeClass = Boolean.class),
            @ApiImplicitParam(name = "numberOrNameOrSpecifications", value = "编号/设备名称/规格型号", dataTypeClass = String.class)
    })
    public Result<?> getListInstrumentInformation(Integer pageNo,
                                                  Integer pageSize,
                                                  Integer conditions,
                                                  Integer classifyId,
                                                  Boolean whetherWhether,
                                                  String numberOrNameOrSpecifications) {
        IPage<Map<String, Object>> pageList = instrumentService.getListInstrumentInformation(conditions, whetherWhether, numberOrNameOrSpecifications,
                classifyId, new Page<Objects>(pageNo, pageSize));
        Map<String, Object> map = new HashMap<>();
        map.put("row", pageList.getRecords());
        map.put("total", pageList.getTotal());
        return Result.success(map);
    }
    @ApiOperation("删除仪器数据")
    @DeleteMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "instrumentId", value = "仪器Id", dataTypeClass = String.class, required = true)
    })
    public Result<?> deleteInstrumentInformation(String instrumentId) {
        Boolean isDeleteSuccess = instrumentService.deleteInstrumentInformation(instrumentId);
        if (isDeleteSuccess){
            return Result.success("删除仪器成功!");
        }
        return Result.fail("删除仪器失败!");
    }
    @ApiOperation("添加仪器时保管人下拉框数据")
    @GetMapping("/get_user")
    public Result<?> getMapUserInformation() {
        return Result.success(userService.getUserNameAndId());
    }
    @ApiOperation("根据仪器Id获取信息用于编辑")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "InstrumentId", value = "分类Id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/get_instrument")
    public Result<?> getIdInstrumentInformation(Integer InstrumentId) {
        Instrument idInstrumentInformation = instrumentService.getIdInstrumentInformation(InstrumentId);
        return Result.success(idInstrumentInformation);
    }
    @ApiOperation("根据仪器Id更新数据")
    @PutMapping("/update")
    public Result<?> updateEquipmentPointInformation(@RequestBody UpdateInstrumentDto updateInstrumentDto) throws Exception {
        Instrument instrument = JackSonUtil.unmarshal(JackSonUtil.marshal(updateInstrumentDto), Instrument.class);
        Integer isUpdateSuccess = instrumentService.updateEquipmentPointInformation(instrument);
        if (isUpdateSuccess == 1){
            return Result.success("更新【" + instrument.getEquipmentName() + "】成功!");
        }
        return Result.fail("仪器设备编号重复,更新【" + instrument.getEquipmentName() + "】失败! ");
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/MetricalInformationController.java
@@ -1,9 +1,24 @@
package com.yuanchu.limslaboratory.controller;
import com.yuanchu.limslaboratory.pojo.EquipmentPoint;
import com.yuanchu.limslaboratory.pojo.MetricalInformation;
import com.yuanchu.limslaboratory.pojo.dto.UpdateEquipmentPointDto;
import com.yuanchu.limslaboratory.pojo.dto.UpdateMetricalInformationDto;
import com.yuanchu.limslaboratory.service.MetricalInformationService;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -13,8 +28,63 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Api(tags = "实验室-->设备台账-->4、计量信息")
@RestController
@RequestMapping("/metrical-information")
public class MetricalInformationController {
    @Autowired
    private MetricalInformationService metricalInformationService;
    @Autowired
    private UserService userService;
    @ApiOperation("添加计量信息")
    @PostMapping("/add")
    public Result<?> addMetricalInformation(MetricalInformation metricalInformation,
                                            @RequestPart(value = "file", required = false) MultipartFile file) {
        Integer isInsertSuccess = metricalInformationService.addEquipmentPointInformation(metricalInformation, file);
        if (isInsertSuccess == 1){
            return Result.success("添加【"+ metricalInformation.getMeasurementUnit() +"】成功!");
        }
        return Result.fail("添加【"+ metricalInformation.getMeasurementUnit() +"】失败!设备码点编码重复!");
    }
    @ApiOperation("查询所有计量信息数据")
    @GetMapping("/list")
    public Result<?> getListMetricalInformation() {
        List<Map<String, Object>> list = metricalInformationService.getListEquipmentPointInformation();
        return Result.success(list);
    }
    @ApiOperation("根据计量信息Id删除数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "metricalInformationId", value = "计量信息Id", dataTypeClass = Integer.class, required = true)
    })
    @DeleteMapping("/delete")
    public Result<?> deleteMetricalInformation(Integer metricalInformationId) {
        Integer isDeleteSuccess = metricalInformationService.deleteMetricalInformation(metricalInformationId);
        if (isDeleteSuccess == 1){
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
    @ApiOperation("根据计量信息Id更新数据")
    @PutMapping("/update")
    public Result<?> updateMetricalInformation(UpdateMetricalInformationDto updateMetricalInformationDto,
                                                     @RequestPart(value = "file", required = false) MultipartFile file) throws Exception {
        MetricalInformation metricalInformation = JackSonUtil.unmarshal(JackSonUtil.marshal(updateMetricalInformationDto), MetricalInformation.class);
        Integer isUpdateSuccess = metricalInformationService.updateMetricalInformation(metricalInformation, file);
        if (isUpdateSuccess == 1){
            return Result.success("更新成功!");
        }
        return Result.fail("更新失败!");
    }
    @ApiOperation("添加计量信息时负责人下拉框数据")
    @GetMapping("/get_user")
    public Result<?> getMapUserInformation() {
        return Result.success(userService.getUserNameAndId());
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/Classify.java
ÎļþÒÑɾ³ý
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/EquipmentPoint.java
ÎļþÒÑɾ³ý
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/Instrument.java
ÎļþÒÑɾ³ý
laboratory-server/src/main/java/com/yuanchu/limslaboratory/entity/MetricalInformation.java
ÎļþÒÑɾ³ý
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/ClassifyMapper.java
@@ -1,6 +1,6 @@
package com.yuanchu.limslaboratory.mapper;
import com.yuanchu.limslaboratory.entity.Classify;
import com.yuanchu.limslaboratory.pojo.Classify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/EquipmentPointMapper.java
@@ -1,7 +1,13 @@
package com.yuanchu.limslaboratory.mapper;
import com.yuanchu.limslaboratory.entity.EquipmentPoint;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.EquipmentPoint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -13,4 +19,5 @@
 */
public interface EquipmentPointMapper extends BaseMapper<EquipmentPoint> {
    List<Map<String, Object>> getListEquipmentPointInformation();
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/InstrumentMapper.java
@@ -1,7 +1,12 @@
package com.yuanchu.limslaboratory.mapper;
import com.yuanchu.limslaboratory.entity.Instrument;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -13,4 +18,5 @@
 */
public interface InstrumentMapper extends BaseMapper<Instrument> {
    IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions,Boolean whetherWhether, String numberOrNameOrSpecifications, Integer classifyId, Page<Objects> page);
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/MetricalInformationMapper.java
@@ -1,7 +1,10 @@
package com.yuanchu.limslaboratory.mapper;
import com.yuanchu.limslaboratory.entity.MetricalInformation;
import com.yuanchu.limslaboratory.pojo.MetricalInformation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -13,4 +16,5 @@
 */
public interface MetricalInformationMapper extends BaseMapper<MetricalInformation> {
    List<Map<String, Object>> getListEquipmentPointInformation();
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/Classify.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.yuanchu.limslaboratory.pojo;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * <p>
 *
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Classify对象", description="")
public class Classify implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "分类主键", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "分类父名称", example = "温度测量仪表")
    private String fatherName;
    @ApiModelProperty(value = "分类子名称", example = "体温计",required = true)
    private String sonName;
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    private Integer state;
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/EquipmentPoint.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
package com.yuanchu.limslaboratory.pojo;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * <p>
 *
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="EquipmentPoint对象", description="")
public class EquipmentPoint implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "仪器Id å…³è”", example = "1", required = true)
    private Integer instrumentId;
    @ApiModelProperty(value = "用户Id å…³è”", hidden = true)
    private Integer userId;
    @ApiModelProperty(value = "码点编号", example = "Area-1", required = true)
    private String equipmentPoint;
    @ApiModelProperty(value = "码点名称", example = "导体屏蔽(壁厚面积)", required = true)
    private String equipmentPointName;
    @ApiModelProperty(value = "单位", example = "mm", required = true)
    private String unit;
    @ApiModelProperty(value = "描述", example = "疯了,做不了")
    private String descriptiveness;
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    private Integer state;
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/Instrument.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
package com.yuanchu.limslaboratory.pojo;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * <p>
 *
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Instrument对象", description="")
public class Instrument implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "分类ID å…³è”", example = "1", required = true)
    private Integer classifyId;
    @ApiModelProperty(value = "保管人:用户表关联Id", example = "9", required = true)
    private Integer userId;
    @ApiModelProperty(value = "仪器设备编号", example = "JSTC-W1-00001", required = true)
    private String equipmentCode;
    @ApiModelProperty(value = "仪器设备名称", example = "数字电桥", required = true)
    private String equipmentName;
    @ApiModelProperty(value = "默认1;1:运行、2:故障、3:报修、4:检修、5:待机", example = "1", required = true)
    private Integer conditions;
    @ApiModelProperty(value = "规格型号", example = "WCDMS-1", required = true)
    private String specificationsModels;
    @ApiModelProperty(value = "测量范围", example = "12毫米")
    private String measuringRange;
    @ApiModelProperty(value = "误差", example = "0.000001微米")
    private String errorRate;
    @ApiModelProperty(value = "生产厂家", example = "江苏鵷雏")
    private String manufacturer;
    @ApiModelProperty(value = "到货日期", example = "2001-07-06", dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date arrivalDate;
    @ApiModelProperty(value = "验收日期", example = "2060-07-06", dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date acceptanceDate;
    @ApiModelProperty(value = "存放地", example = "地球亚洲中国江苏南通")
    private String storagePlace;
    @ApiModelProperty(value = "是否支持数采;1:支持;0:不支持", example = "1")
    private Integer whetherDataAcquisition;
    @ApiModelProperty(value = "是否需要仪器设备计量:如果需要计量周期必填;如果不需要计量周期不必填.1:需要;0:不需要", example = "0")
    private Integer equipmentMeasurement;
    @ApiModelProperty(value = "计量截止有效期:与equipmentMeasurement相关联", example = "12")
    private Integer termValidity;
    @ApiModelProperty(value = "描述", example = "疯狂星期五!!!")
    private String descriptiveness;
    @JsonIgnore
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    private Integer state;
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;
    @JsonIgnore
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/MetricalInformation.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
package com.yuanchu.limslaboratory.pojo;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * <p>
 *
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="MetricalInformation对象", description="")
public class MetricalInformation implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "用户关联Id", example = "7", required = true)
    private Integer userId;
    @ApiModelProperty(value = "计量单位", example = "GB", required = true)
    private String measurementUnit;
    @ApiModelProperty(value = "开始日期", example = "2023-07-06", required = true, dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME)
    private Date beginDate;
    @ApiModelProperty(value = "结束日期", example = "2026-07-06", required = true, dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME)
    private Date endDate;
    @ApiModelProperty(value = "不确定度", example = "0.3%", required = true)
    private String uncertainty;
    @ApiModelProperty(value = "结果: 1:合格;2:矫正后可用;3:不合格", example = "1", required = true)
    private Integer result;
    @ApiModelProperty(value = "性能指标", example = "10086")
    private String performanceIndex;
    @ApiModelProperty(value = "备注", example = "10086.com")
    private String remarks;
    @ApiModelProperty(value = "文件路径", hidden = true)
    private String filePath;
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    private Integer state;
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateClassifyDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.yuanchu.limslaboratory.pojo.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UpdateClassifyDto对象", description="")
public class UpdateClassifyDto {
    @ApiModelProperty(value = "分类主键", example = "1", required = true)
    private Integer id;
    @ApiModelProperty(value = "分类父名称", example = "温度测量仪表")
    private String fatherName;
    @ApiModelProperty(value = "分类子名称", example = "体温计",required = true)
    private String sonName;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateEquipmentPointDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
package com.yuanchu.limslaboratory.pojo.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UpdateEquipmentPointDto对象", description="")
public class UpdateEquipmentPointDto {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键", example = "1", required = true)
    private Integer id;
    @ApiModelProperty(value = "仪器Id å…³è”", example = "1", required = true)
    private Integer instrumentId;
    @ApiModelProperty(value = "码点编号", example = "Area-1", required = true)
    private String equipmentPoint;
    @ApiModelProperty(value = "码点名称", example = "导体屏蔽(壁厚面积)", required = true)
    private String equipmentPointName;
    @ApiModelProperty(value = "单位", example = "mm", required = true)
    private String unit;
    @ApiModelProperty(value = "描述", example = "疯了,做不了")
    private String descriptiveness;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateInstrumentDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
package com.yuanchu.limslaboratory.pojo.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UpdateInstrumentDto对象", description="")
public class UpdateInstrumentDto {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "计量信息主键",example = "1", required = true)
    private Integer id;
    @ApiModelProperty(value = "分类ID å…³è”", example = "1", required = true)
    private Integer classifyId;
    @ApiModelProperty(value = "保管人:用户表关联Id", example = "9", required = true)
    private Integer userId;
    @ApiModelProperty(value = "仪器设备编号", example = "JSTC-W1-00001", required = true)
    private String equipmentCode;
    @ApiModelProperty(value = "仪器设备名称", example = "数字电桥", required = true)
    private String equipmentName;
    @ApiModelProperty(value = "默认1;1:运行、2:故障、3:报修、4:检修、5:待机", example = "1", required = true)
    private Integer conditions;
    @ApiModelProperty(value = "规格型号", example = "WCDMS-1", required = true)
    private String specificationsModels;
    @ApiModelProperty(value = "测量范围", example = "12毫米")
    private String measuringRange;
    @ApiModelProperty(value = "误差", example = "0.000001微米")
    private String errorRate;
    @ApiModelProperty(value = "生产厂家", example = "江苏鵷雏")
    private String manufacturer;
    @ApiModelProperty(value = "到货日期", example = "2001-07-06", dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date arrivalDate;
    @ApiModelProperty(value = "验收日期", example = "2060-07-06", dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date acceptanceDate;
    @ApiModelProperty(value = "存放地", example = "地球亚洲中国江苏南通")
    private String storagePlace;
    @ApiModelProperty(value = "是否支持数采;1:支持;0:不支持", example = "1")
    private Integer whetherDataAcquisition;
    @ApiModelProperty(value = "是否需要仪器设备计量:如果需要计量周期必填;如果不需要计量周期不必填.1:需要;0:不需要", example = "0")
    private Integer equipmentMeasurement;
    @ApiModelProperty(value = "计量截止有效期:与equipmentMeasurement相关联", example = "12")
    private Integer termValidity;
    @ApiModelProperty(value = "描述", example = "疯狂星期五!!!")
    private String descriptiveness;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateMetricalInformationDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
package com.yuanchu.limslaboratory.pojo.dto;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UpdateMetricalInformationDto对象", description="")
public class UpdateMetricalInformationDto {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private Integer id;
    @ApiModelProperty(value = "用户关联Id", example = "7", required = true)
    private Integer userId;
    @ApiModelProperty(value = "计量单位", example = "GB", required = true)
    private String measurementUnit;
    @ApiModelProperty(value = "开始日期", example = "2023-07-06", required = true, dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME)
    private Date beginDate;
    @ApiModelProperty(value = "结束日期", example = "2026-07-06", required = true, dataType = "date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME)
    private Date endDate;
    @ApiModelProperty(value = "不确定度", example = "0.3%", required = true)
    private String uncertainty;
    @ApiModelProperty(value = "结果: 1:合格;2:矫正后可用;3:不合格", example = "1", required = true)
    private Integer result;
    @ApiModelProperty(value = "性能指标", example = "10086")
    private String performanceIndex;
    @ApiModelProperty(value = "备注", example = "10086.com")
    private String remarks;
    @ApiModelProperty(value = "文件路径", hidden = true)
    private String filePath;
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/ClassifyService.java
@@ -1,7 +1,10 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.entity.Classify;
import com.yuanchu.limslaboratory.pojo.Classify;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -13,4 +16,11 @@
 */
public interface ClassifyService extends IService<Classify> {
    Integer addClassifyInformation(Classify classify);
    List<Map<String, Object>> getListClassifyInformation(String classifyName);
    Boolean deleteClassifyInformation(String classifyId);
    Boolean updateClassifyInformation(Classify classify);
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/EquipmentPointService.java
@@ -1,7 +1,13 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.entity.EquipmentPoint;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.EquipmentPoint;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -13,4 +19,11 @@
 */
public interface EquipmentPointService extends IService<EquipmentPoint> {
    Integer addEquipmentPointInformation(EquipmentPoint equipmentPoint);
    List<Map<String, Object>> getListEquipmentPointInformation();
    Integer deleteEquipmentPointInformation(Integer equipmentPointId);
    Integer updateEquipmentPointInformation(EquipmentPoint equipmentPoint);
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/InstrumentService.java
@@ -1,7 +1,12 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.entity.Instrument;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -13,4 +18,19 @@
 */
public interface InstrumentService extends IService<Instrument> {
    Integer addInstrumentInformation(Instrument instrument);
    Boolean deleteInstrumentInformation(String instrumentId);
    IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions, Boolean whetherWhether, String numberOrNameOrSpecifications,
                                                            Integer classifyId, Page<Objects> page);
    /**
     * æ›´æ–°ä»ªå™¨æ•°æ®çš„æ—¶å€™éœ€è¦èŽ·å–æ‰€æœ‰æ•°æ®
     * @param instrumentId
     * @return
     */
    Instrument getIdInstrumentInformation(Integer instrumentId);
    Integer updateEquipmentPointInformation(Instrument instrument);
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/MetricalInformationService.java
@@ -1,7 +1,11 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.entity.MetricalInformation;
import com.yuanchu.limslaboratory.pojo.MetricalInformation;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -13,4 +17,11 @@
 */
public interface MetricalInformationService extends IService<MetricalInformation> {
    Integer addEquipmentPointInformation(MetricalInformation metricalInformation, MultipartFile file);
    List<Map<String, Object>> getListEquipmentPointInformation();
    Integer deleteMetricalInformation(Integer metricalInformationId);
    Integer updateMetricalInformation(MetricalInformation metricalInformation, MultipartFile file);
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ClassifyServiceImpl.java
@@ -1,10 +1,17 @@
package com.yuanchu.limslaboratory.service.impl;
import com.yuanchu.limslaboratory.entity.Classify;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuanchu.limslaboratory.pojo.Classify;
import com.yuanchu.limslaboratory.mapper.ClassifyMapper;
import com.yuanchu.limslaboratory.service.ClassifyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -17,4 +24,75 @@
@Service
public class ClassifyServiceImpl extends ServiceImpl<ClassifyMapper, Classify> implements ClassifyService {
    @Resource
    private ClassifyMapper classifyMapper;
    @Override
    public Integer addClassifyInformation(Classify classify) {
        if (ObjectUtils.isEmpty(classify.getFatherName())){
            classify.setFatherName(classify.getSonName());
            classify.setSonName(null);
            LambdaQueryWrapper<Classify> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(Classify::getFatherName, classify.getFatherName());
            wrapper.isNull(Classify::getSonName);
            wrapper.eq(Classify::getState, 1);
            Classify classify1 = classifyMapper.selectOne(wrapper);
            if (ObjectUtils.isEmpty(classify1)){
                return classifyMapper.insert(classify);
            }
            return 2;
        }
        LambdaQueryWrapper<Classify> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Classify::getFatherName, classify.getFatherName());
        wrapper.eq(Classify::getSonName, classify.getSonName());
        wrapper.eq(Classify::getState, 1);
        Classify classify1 = classifyMapper.selectOne(wrapper);
        if (ObjectUtils.isEmpty(classify1)){
            return classifyMapper.insert(classify);
        } else {
            return 3;
        }
    }
    @Override
    public List<Map<String, Object>> getListClassifyInformation(String classifyName) {
        LambdaQueryWrapper<Classify> wrapper = new LambdaQueryWrapper<>();
        if (!ObjectUtils.isEmpty(classifyName)){
            wrapper.like(Classify::getFatherName, classifyName);
        }
        wrapper.groupBy(Classify::getFatherName);
        wrapper.select(Classify::getId, Classify::getFatherName);
        List<Map<String, Object>> maps = classifyMapper.selectMaps(wrapper);
        for (Map<String, Object> map : maps){
            LambdaQueryWrapper<Classify> wrapper1 = new LambdaQueryWrapper<>();
            wrapper1.eq(Classify::getFatherName, map.get("father_name"));
            wrapper1.isNotNull(Classify::getSonName);
            wrapper1.select(Classify::getId, Classify::getSonName);
            List<Map<String, Object>> maps1 = classifyMapper.selectMaps(wrapper1);
            if (!ObjectUtils.isEmpty(maps1)){
                map.put("children", maps1);
                map.remove("id");
            } else {
                map.put("children", null);
            }
        }
        return maps;
    }
    @Override
    public Boolean deleteClassifyInformation(String classifyId) {
        LambdaUpdateWrapper<Classify> wrapper = new LambdaUpdateWrapper<>();
        wrapper.eq(Classify::getId, classifyId);
        wrapper.set(Classify::getState, 0);
        int isDeleteSuccess = classifyMapper.update(new Classify(), wrapper);
        return isDeleteSuccess > 0;
    }
    @Override
    public Boolean updateClassifyInformation(Classify classify) {
        LambdaUpdateWrapper<Classify> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Classify::getId, classify.getId());
        int isUpdateClassifySuccess = classifyMapper.update(classify, updateWrapper);
        return isUpdateClassifySuccess > 0;
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/EquipmentPointServiceImpl.java
@@ -1,10 +1,21 @@
package com.yuanchu.limslaboratory.service.impl;
import com.yuanchu.limslaboratory.entity.EquipmentPoint;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.EquipmentPoint;
import com.yuanchu.limslaboratory.mapper.EquipmentPointMapper;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.service.EquipmentPointService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -17,4 +28,47 @@
@Service
public class EquipmentPointServiceImpl extends ServiceImpl<EquipmentPointMapper, EquipmentPoint> implements EquipmentPointService {
    @Resource
    private EquipmentPointMapper equipmentPointMapper;
    @Override
    public Integer addEquipmentPointInformation(EquipmentPoint equipmentPoint) {
        LambdaQueryWrapper<EquipmentPoint> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EquipmentPoint::getEquipmentPoint, equipmentPoint.getEquipmentPoint());
        wrapper.eq(EquipmentPoint::getState, 1);
        wrapper.select(EquipmentPoint::getEquipmentPoint);
        EquipmentPoint equipmentPoint1 = equipmentPointMapper.selectOne(wrapper);
        if (ObjectUtils.isEmpty(equipmentPoint1)){
            return equipmentPointMapper.insert(equipmentPoint);
        }
        return 0;
    }
    @Override
    public List<Map<String, Object>> getListEquipmentPointInformation() {
        return equipmentPointMapper.getListEquipmentPointInformation();
    }
    @Override
    public Integer deleteEquipmentPointInformation(Integer equipmentPointId) {
        LambdaUpdateWrapper<EquipmentPoint> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(EquipmentPoint::getId, equipmentPointId);
        updateWrapper.set(EquipmentPoint::getState, 0);
        return equipmentPointMapper.update(new EquipmentPoint(), updateWrapper);
    }
    @Override
    public Integer updateEquipmentPointInformation(EquipmentPoint equipmentPoint) {
        LambdaQueryWrapper<EquipmentPoint> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EquipmentPoint::getEquipmentPoint, equipmentPoint.getEquipmentPoint());
        wrapper.eq(EquipmentPoint::getState, 1);
        wrapper.select(EquipmentPoint::getId, EquipmentPoint::getId);
        EquipmentPoint equipmentPoint1 = equipmentPointMapper.selectOne(wrapper);
        if (ObjectUtils.isEmpty(equipmentPoint1)){
            return equipmentPointMapper.updateById(equipmentPoint);
        } else if (equipmentPoint.getId().equals(equipmentPoint1.getId())){
            return equipmentPointMapper.updateById(equipmentPoint);
        }
        return 0;
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InstrumentServiceImpl.java
@@ -1,10 +1,20 @@
package com.yuanchu.limslaboratory.service.impl;
import com.yuanchu.limslaboratory.entity.Instrument;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.mapper.InstrumentMapper;
import com.yuanchu.limslaboratory.service.InstrumentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -17,4 +27,56 @@
@Service
public class InstrumentServiceImpl extends ServiceImpl<InstrumentMapper, Instrument> implements InstrumentService {
    @Resource
    private InstrumentMapper instrumentMapper;
    @Override
    public Integer addInstrumentInformation(Instrument instrument) {
        LambdaQueryWrapper<Instrument> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Instrument::getEquipmentCode, instrument.getEquipmentCode());
        wrapper.eq(Instrument::getState, 1);
        wrapper.select(Instrument::getEquipmentCode);
        Instrument instrument1 = instrumentMapper.selectOne(wrapper);
        if (ObjectUtils.isEmpty(instrument1)){
            return instrumentMapper.insert(instrument);
        }
        return 0;
    }
    @Override
    public Boolean deleteInstrumentInformation(String instrumentId) {
        LambdaUpdateWrapper<Instrument> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Instrument::getId, instrumentId);
        updateWrapper.set(Instrument::getState, 0);
        int isUpdateSuccess = instrumentMapper.update(new Instrument(), updateWrapper);
        return isUpdateSuccess > 0;
    }
    @Override
    public IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions, Boolean whetherWhether, String numberOrNameOrSpecifications,
                                                                   Integer classifyId, Page<Objects> page) {
        return instrumentMapper.getListInstrumentInformation(conditions, whetherWhether, numberOrNameOrSpecifications, classifyId, page);
    }
    @Override
    public Instrument getIdInstrumentInformation(Integer instrumentId) {
        LambdaQueryWrapper<Instrument> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Instrument::getId, instrumentId);
        return instrumentMapper.selectOne(wrapper);
    }
    @Override
    public Integer updateEquipmentPointInformation(Instrument instrument) {
        LambdaQueryWrapper<Instrument> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Instrument::getEquipmentCode, instrument.getEquipmentCode());
        wrapper.eq(Instrument::getState, 1);
        wrapper.select(Instrument::getEquipmentCode, Instrument::getId);
        Instrument instrument1 = instrumentMapper.selectOne(wrapper);
        if (ObjectUtils.isEmpty(instrument1)){
            return instrumentMapper.updateById(instrument);
        } else if (instrument.getId().equals(instrument1.getId())){
            return instrumentMapper.updateById(instrument);
        }
        return 0;
    }
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MetricalInformationServiceImpl.java
@@ -1,10 +1,20 @@
package com.yuanchu.limslaboratory.service.impl;
import com.yuanchu.limslaboratory.entity.MetricalInformation;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuanchu.limslaboratory.pojo.MetricalInformation;
import com.yuanchu.limslaboratory.mapper.MetricalInformationMapper;
import com.yuanchu.limslaboratory.service.MetricalInformationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.utils.FileSaveUtil;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -17,4 +27,44 @@
@Service
public class MetricalInformationServiceImpl extends ServiceImpl<MetricalInformationMapper, MetricalInformation> implements MetricalInformationService {
    @Resource
    private MetricalInformationMapper metricalInformationMapper;
    @Override
    public Integer addEquipmentPointInformation(MetricalInformation metricalInformation, MultipartFile file) {
        if (!ObjectUtils.isEmpty(file)){
            String fileName = FileSaveUtil.StoreFile(file);
            metricalInformation.setFilePath(fileName);
        }
        return metricalInformationMapper.insert(metricalInformation);
    }
    @Override
    public List<Map<String, Object>> getListEquipmentPointInformation() {
        return metricalInformationMapper.getListEquipmentPointInformation();
    }
    @Override
    public Integer deleteMetricalInformation(Integer metricalInformationId) {
        LambdaUpdateWrapper<MetricalInformation> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(MetricalInformation::getId, metricalInformationId);
        updateWrapper.set(MetricalInformation::getState, 0);
        return metricalInformationMapper.update(new MetricalInformation(), updateWrapper);
    }
    @Override
    public Integer updateMetricalInformation(MetricalInformation metricalInformation, MultipartFile file) {
        if (!ObjectUtils.isEmpty(file)){
            String fileName = FileSaveUtil.StoreFile(file);
            metricalInformation.setFilePath(fileName);
            LambdaQueryWrapper<MetricalInformation> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(MetricalInformation::getId, metricalInformation.getId());
            wrapper.select(MetricalInformation::getFilePath);
            MetricalInformation metricalInformation1 = metricalInformationMapper.selectOne(wrapper);
            if (!ObjectUtils.isEmpty(metricalInformation1.getFilePath())){
                FileSaveUtil.DeleteFile(metricalInformation1.getFilePath());
            }
        }
        return metricalInformationMapper.updateById(metricalInformation);
    }
}
laboratory-server/src/main/resources/mapper/EquipmentPointMapper.xml
@@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.EquipmentPointMapper">
    <select id="getListEquipmentPointInformation" resultType="map">
        SELECT e.`id`, e.`equipment_point` equipmentPoint, e.`equipment_point_name` equipmentPointName, e.`unit`,u.`name`, DATE_FORMAT(e.`update_time`, '%Y-%m-%d') updateTime, e.`descriptiveness`
        FROM equipment_point e, `user` u
        WHERE e.`user_id` = u.`id`
    </select>
</mapper>
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml
@@ -2,4 +2,21 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.InstrumentMapper">
    <select id="getListInstrumentInformation" resultType="map">
        SELECT i.`id`, i.`equipment_code`, i.`equipment_name`, i.`specifications_models`, u.`name`,
               DATE_FORMAT(DATE_ADD(i.`create_time`, INTERVAL i.`term_validity` MONTH), '%Y-%m-%d') termValidity, i.`conditions`, i.`storage_place`
        FROM instrument i, `user` u
        WHERE i.`state` = 1
          AND i.`classify_id` = #{classifyId}
        <if test="conditions != null">
            AND i.`conditions` = #{conditions}
        </if>
        <if test="numberOrNameOrSpecifications != null and numberOrNameOrSpecifications != ''">
            AND CONCAT(i.`equipment_code`, i.`equipment_name`, i.`specifications_models`) LIKE CONCAT('%',#{numberOrNameOrSpecifications},'%')
        </if>
        <if test="whetherWhether == true">
            AND DATE_FORMAT(DATE_ADD(i.`create_time`, INTERVAL i.`term_validity` MONTH), '%Y-%m-%d') <![CDATA[<]]> NOW()
        </if>
        AND i.`user_id` = u.`id`
    </select>
</mapper>
laboratory-server/src/main/resources/mapper/MetricalInformationMapper.xml
@@ -2,4 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.MetricalInformationMapper">
    <select id="getListEquipmentPointInformation" resultType="map">
        SELECT m.`id`, u.`name`, m.`measurement_unit`, DATE_FORMAT(m.`begin_date`, '%Y-%m-%d') beginDate, DATE_FORMAT(m.`end_date`, '%Y-%m-%d') endDate,
               m.`uncertainty`, m.`result`, m.`performance_index`, m.`remarks`, m.`file_path`, DATE_FORMAT(m.`create_time`, '%Y-%m-%d') createDate
        FROM metrical_information m, `user` u
        WHERE m.`user_id` = u.`id`
          AND m.`state` = 1
    </select>
</mapper>
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java
@@ -2,6 +2,7 @@
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation;
import com.yuanchu.limslaboratory.service.MaterialService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
@@ -24,7 +25,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "标准库-->规格-->查看-->父->物料")
@Api(tags = "标准库-->4、规格-->查看-->父模块")
@RestController
@RequestMapping("/material")
public class MaterialController {
@@ -32,7 +33,7 @@
    @Autowired
    private MaterialService materialService;
    @ApiOperation("物料库-->添加物料")
    @ApiOperation("添加物料")
    @PostMapping("/add")
    public Result<?> addMaterialInformation(@RequestBody Material material) {
        Integer isMaterialSuccess = materialService.addMaterialInformation(material);
@@ -42,7 +43,7 @@
        return Result.fail("添加物料【"+ material.getName() +"】失败!");
    }
    @ApiOperation("物料库-->根据规格ID查询所有物料")
    @ApiOperation("根据规格ID查询所有物料")
    @GetMapping("/list")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "规格ID", name = "specificationsId", dataTypeClass = String.class)
@@ -52,17 +53,17 @@
        return Result.success(listMaterialInformation);
    }
    @ApiOperation("物料库-->根据规格ID查询物料详情")
    @ApiOperation("根据物料ID查询物料详情")
    @GetMapping("/list_id")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "物料ID", name = "materialId", dataTypeClass = String.class)
    })
    public Result<?> getListIdMaterialInformation(String materialId) {
    public Result<?> getListIdMaterialInformation(String materialId) throws Exception {
        Material listIdMaterialInformation = materialService.ListIdMaterialInformation(materialId);
        return Result.success(listIdMaterialInformation);
    }
    @ApiOperation("物料库-->根据物料ID删除物料")
    @ApiOperation("根据物料ID删除物料")
    @DeleteMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "物料ID", name = "materialId", dataTypeClass = String.class)
@@ -75,9 +76,10 @@
        return Result.fail("删除失败!");
    }
    @ApiOperation("物料库-->修改物料")
    @ApiOperation("修改物料")
    @PutMapping("/update")
    public Result<?> updateMaterialInformation(@RequestBody Material material) {
    public Result<?> updateMaterialInformation(@RequestBody UpdateMaterialInformation updateMaterialInformation) throws Exception {
        Material material = JackSonUtil.unmarshal(JackSonUtil.marshal(updateMaterialInformation), Material.class);
        Integer isUpdateMaterialSuccess = materialService.updateMaterialInformation(material);
        if (isUpdateMaterialSuccess == 1) {
            return Result.success("修改物料【"+ material.getName() +"】成功!");
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java
@@ -21,7 +21,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "标准库-->规格-->查看-->父-->子")
@Api(tags = "标准库-->5、规格-->查看-->子模块")
@RestController
@RequestMapping("/product")
public class ProductController {
@@ -29,7 +29,7 @@
    @Autowired
    private ProductService productService;
    @ApiOperation("测试标准模块-->添加测试标准")
    @ApiOperation("添加测试标准")
    @PostMapping("/add")
    public Result<?> addProductInformation(@RequestHeader("X-Token") String token, @RequestBody Product product) throws Exception {
        Object userMessage = RedisUtil.get(token);
@@ -46,7 +46,7 @@
        return Result.fail("添加物料【"+ product.getName() +"】失败!");
    }
    @ApiOperation("物料库-->根据物料ID查询所有测试标准")
    @ApiOperation("根据物料ID查询所有测试标准")
    @GetMapping("/list")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "物料ID", name = "materialId", dataTypeClass = String.class)
@@ -56,7 +56,7 @@
        return Result.success(listMaterialInformation);
    }
    @ApiOperation("物料库-->根据测试标准ID查询基本信息")
    @ApiOperation("根据测试标准ID查询基本信息")
    @GetMapping("/productId")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "测试标准ID", name = "productId", dataTypeClass = String.class)
@@ -66,7 +66,7 @@
        return Result.success(productInformation);
    }
    @ApiOperation("物料库-->删除测试标准模块数据")
    @ApiOperation("删除测试标准模块数据")
    @DeleteMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "测试标准ID", name = "productId", dataTypeClass = String.class)
@@ -79,7 +79,7 @@
        return Result.fail("删除失败!");
    }
    @ApiOperation("物料库-->根据测试标准Id修改数据")
    @ApiOperation("根据测试标准Id修改数据")
    @PutMapping("/update")
    public Result<?> updateMaterialInformation(@RequestBody Product product) {
        Integer isUpdateMaterialSuccess = productService.updateMaterialInformation(product);
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java
@@ -28,7 +28,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->型号")
@Api(tags = "标准库-->2、型号")
@RestController
@RequestMapping("/serial-number")
public class SerialNumberController {
@@ -36,7 +36,7 @@
    @Autowired
    private SerialNumberService serialNumberService;
    @ApiOperation("标准库-->添加型号")
    @ApiOperation("添加型号")
    @PostMapping("/add")
    public Result<?> addSerialNumberInformation(@RequestHeader("X-Token") String token,@RequestBody SerialNumber serialNumber) throws Exception {
        Object object = RedisUtil.get(token);
@@ -49,7 +49,7 @@
        return Result.fail("添加【"+ serialNumber.getName() +"】失败!");
    }
    @ApiOperation("标准库-->点击侧边栏标准,分页查询所有型号")
    @ApiOperation("点击侧边栏标准,分页查询所有型号")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "型号/型号名称", name = "IdOrNameOfSerialNumber", dataTypeClass = String.class),
            @ApiImplicitParam(value = "标准号Id", name = "standardsId", dataTypeClass = String.class, required = true),
@@ -65,7 +65,7 @@
        return Result.success(map);
    }
    @ApiOperation("标准库-->根据Id修改型号参数")
    @ApiOperation("根据Id修改型号")
    @PutMapping("/update")
    public Result<?> updateSerialNumberInformation(@RequestHeader("X-Token") String token, @RequestBody SerialNumber serialNumber) throws Exception {
        Object object = RedisUtil.get(token);
@@ -78,7 +78,7 @@
        return Result.fail("更新失败!");
    }
    @ApiOperation("标准库-->根据Id删除型号")
    @ApiOperation("根据Id删除型号")
    @DeleteMapping("/delete")
    public Result<?> deleteSerialNumberInformation(String serialNumberId) {
        Integer isDeleteSerialNumberSuccess = serialNumberService.deleteSerialNumberInformation(serialNumberId);
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
@@ -6,11 +6,10 @@
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.service.SpecificationsService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.MyUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
import com.yuanchu.limslaboratory.vo.UpdateSpeStateSpecifications;
import com.yuanchu.limslaboratory.vo.UpdateSpecificationsInformation;
import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto;
import com.yuanchu.limslaboratory.pojo.dto.UpdateSpecificationsInformationDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -31,7 +30,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->型号-->产品规格")
@Api(tags = "标准库-->3、型号-->产品规格")
@RestController
@RequestMapping("/specifications")
public class SpecificationsController {
@@ -39,7 +38,7 @@
    @Autowired
    private SpecificationsService specificationsService;
    @ApiOperation("标准库-->产品规格")
    @ApiOperation("添加产品规格")
    @PostMapping("/add")
    public Result<?> addSpecificationsInformation(@RequestHeader("X-Token") String token,@RequestBody Specifications specifications) throws Exception {
        Object object = RedisUtil.get(token);
@@ -52,7 +51,7 @@
        return Result.fail("添加【"+ specifications.getName() +"】失败!");
    }
    @ApiOperation("标准库-->根据型号查询产品规格")
    @ApiOperation("根据型号查询产品规格")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
@@ -71,16 +70,16 @@
        return Result.success(map);
    }
    @ApiOperation("标准库-->产品规格-->编辑")
    @ApiOperation("编辑产品规格")
    @PutMapping("/update")
    public Result<?> updateSpecificationsInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateSpecificationsInformation updateSpecificationsInformation) throws Exception {
    public Result<?> updateSpecificationsInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateSpecificationsInformationDto updateSpecificationsInformationDto) throws Exception {
        Object object = RedisUtil.get(token);
        if (ObjectUtils.isEmpty(object)){
            return Result.fail("对不起,请携带Token!");
        }
        Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
        updateSpecificationsInformation.setUserId((Integer) unmarshal.get("id"));
        Specifications specifications = JackSonUtil.unmarshal(JackSonUtil.marshal(updateSpecificationsInformation), Specifications.class);
        updateSpecificationsInformationDto.setUserId((Integer) unmarshal.get("id"));
        Specifications specifications = JackSonUtil.unmarshal(JackSonUtil.marshal(updateSpecificationsInformationDto), Specifications.class);
        Integer isStandardsSuccess = specificationsService.updateSpecificationsInformation(specifications);
        if (isStandardsSuccess == 1) {
            return Result.success("更新【"+ specifications.getName() +"】成功!");
@@ -88,7 +87,7 @@
        return Result.fail("更新【"+ specifications.getName() +"】失败!");
    }
    @ApiOperation("标准库-->产品规格-->删除")
    @ApiOperation("删除产品规格")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "specificationsId", value = "规格Id", dataTypeClass = Integer.class, required = true)
    })
@@ -101,10 +100,10 @@
        return Result.fail("删除失败!");
    }
    @ApiOperation("标准库-->产品规格-->更新规格状态")
    @ApiOperation("更新规格状态")
    @PutMapping("/update_spe_state")
    public Result<?> updateSpeStateSpecifications(@RequestBody UpdateSpeStateSpecifications updateSpeStateSpecifications) {
        Integer isStandardsSuccess = specificationsService.updateSpeStateSpecifications(updateSpeStateSpecifications);
    public Result<?> updateSpeStateSpecifications(@RequestBody UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) {
        Integer isStandardsSuccess = specificationsService.updateSpeStateSpecifications(updateSpeStateSpecificationsDto);
        if (isStandardsSuccess == 1) {
            return Result.success("操作成功!");
        }
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java
@@ -31,7 +31,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->⭐⭐⭐")
@Api(tags = "标准库-->1、⭐⭐⭐")
@RestController
@RequestMapping("/standards")
public class StandardsController {
@@ -39,7 +39,7 @@
    @Autowired
    private StandardsService standardsService;
    @ApiOperation("标准库-->添加标准")
    @ApiOperation("添加标准")
    @PostMapping("/add")
    public Result<?> addStandardsInformation(@RequestHeader("X-Token") String token, @RequestBody Standards standards) throws Exception {
        Object object = RedisUtil.get(token);
@@ -52,14 +52,14 @@
        return Result.fail("添加【"+ standards.getName() +"】失败!");
    }
    @ApiOperation("标准库-->侧边栏查询所有标准数据")
    @ApiOperation("侧边栏查询所有标准数据")
    @GetMapping("/list")
    public Result<?> listStandardsInformation(){
        List<Map<String, Object>> list = standardsService.listStandardsInformation();
        return Result.success(list);
    }
    @ApiOperation("标准库-->点击全部:分页查询所有标准数据")
    @ApiOperation("点击全部:分页查询所有标准数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
@@ -74,7 +74,7 @@
        return Result.success(map);
    }
    @ApiOperation("标准库-->根据Id修改参数")
    @ApiOperation("根据Id修改参数")
    @PutMapping("/update")
    public Result<?> updateStandardsInformation(@RequestHeader("X-Token") String token, @RequestBody Standards standards) throws Exception {
        Object object = RedisUtil.get(token);
@@ -87,7 +87,7 @@
        return Result.fail("更新失败!");
    }
    @ApiOperation("标准库-->根据ID删除数据")
    @ApiOperation("根据ID删除数据")
    @DeleteMapping("/delete")
    public Result<?> deleteStandardsInformation(String standardsId) {
        Integer isDeleteSuccess = standardsService.deleteStandardsInformation(standardsId);
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java
@@ -10,6 +10,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -68,6 +69,5 @@
    @ApiModelProperty(value = "关联 è§„æ ¼id", example = "1", required = true)
    private Integer specificationsId;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateMaterialInformation.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.yuanchu.limslaboratory.pojo.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="标准库-->规格型号-->物料更新", description="用于对规格的更新")
public class UpdateMaterialInformation {
    @ApiModelProperty(value = "物料id", example = "152453211563212", required = true)
    private String id;
    @ApiModelProperty(value = "物料名称", example = "石头", required = true)
    private String name;
    @ApiModelProperty(value = "供应商", example = "百度", required = true)
    private String supplier;
    @ApiModelProperty(value = "物料存放地", example = "仓库一,二号架", required = true)
    private String location;
    @ApiModelProperty(value = "物料数量", example = "200", required = true)
    private Integer num;
    @ApiModelProperty(value = "批次", example = "1", required = true)
    private String batch;
    @ApiModelProperty(value = "盘号", example = "152453211563212", required = true)
    private String reelNumber;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpeStateSpecificationsDto.java
ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/limslaboratory/vo/UpdateSpeStateSpecifications.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.yuanchu.limslaboratory.vo;
package com.yuanchu.limslaboratory.pojo.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -8,7 +8,7 @@
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="标准库-->规格型号-->用于对规格状态的修改", description="用于对规格状态的修改")
public class UpdateSpeStateSpecifications {
public class UpdateSpeStateSpecificationsDto {
    @ApiModelProperty(value = "规格id", example = "2", required = true)
    private Integer id;
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpecificationsInformationDto.java
ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/limslaboratory/vo/UpdateSpecificationsInformation.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.yuanchu.limslaboratory.vo;
package com.yuanchu.limslaboratory.pojo.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -8,7 +8,7 @@
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="标准库-->规格型号-->编辑对象", description="用于对规格的更新")
public class UpdateSpecificationsInformation {
public class UpdateSpecificationsInformationDto {
    @ApiModelProperty(value = "规格id", example = "2", required = true)
    private Integer id;
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java
@@ -2,6 +2,7 @@
import com.yuanchu.limslaboratory.pojo.Material;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation;
import java.util.List;
import java.util.Map;
@@ -54,5 +55,5 @@
     * @param materialId
     * @return
     */
    Material ListIdMaterialInformation(String materialId);
    Material ListIdMaterialInformation(String materialId) throws Exception;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SpecificationsService.java
@@ -2,13 +2,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.mapper.SpecificationsMapper;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.limslaboratory.vo.UpdateSpeStateSpecifications;
import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -41,5 +39,5 @@
    List<Integer> SerialNumberIdDeleteSpecifications(List<String> deleteSerialNumberId);
    Integer updateSpeStateSpecifications(UpdateSpeStateSpecifications updateSpeStateSpecifications);
    Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java
@@ -5,9 +5,11 @@
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.mapper.MaterialMapper;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation;
import com.yuanchu.limslaboratory.service.MaterialService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.service.ProductService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java
@@ -4,13 +4,11 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.SerialNumber;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.mapper.SpecificationsMapper;
import com.yuanchu.limslaboratory.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.vo.UpdateSpeStateSpecifications;
import io.swagger.models.auth.In;
import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -119,10 +117,10 @@
    }
    @Override
    public Integer updateSpeStateSpecifications(UpdateSpeStateSpecifications updateSpeStateSpecifications) {
    public Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) {
        LambdaUpdateWrapper<Specifications> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Specifications::getId, updateSpeStateSpecifications.getId());
        updateWrapper.set(Specifications::getSpe_state, updateSpeStateSpecifications.getSpe_state());
        updateWrapper.eq(Specifications::getId, updateSpeStateSpecificationsDto.getId());
        updateWrapper.set(Specifications::getSpe_state, updateSpeStateSpecificationsDto.getSpe_state());
        return specificationsMapper.update(new Specifications(), updateWrapper);
    }
}
standard-server/src/main/resources/mapper/SpecificationsMapper.xml
@@ -13,7 +13,8 @@
    </select>
    <select id="selectSNameSNName" resultType="Map">
        select m.num,m.supplier,m.name m_name,m.location,m.batch,m.reel_number,concat(s.name,'/',sn.name) ss_name,s.voltage_level,s.cross_section,s.number_of_cores,s.instruct from material m,specifications s,serial_number sn
        select m.num,m.supplier,m.name m_name,m.location,m.batch,m.reel_number,concat(s.name,'/',sn.name) ss_name,s.voltage_level,s.cross_section,s.number_of_cores,s.instruct
        from material m,specifications s,serial_number sn
        where m.specifications_id = s.id
        and s.serial_id = sn.id
        and m.id = #{materialId}
sys/src/main/java/com/yuanchu/limslaboratory/CodeGenerator.java
@@ -39,7 +39,8 @@
                .setOpen(false) // æ˜¯å¦æ‰“å¼€
                .setSwagger2(true) //实体属性 Swagger2 æ³¨è§£
                .setServiceName("%sService") // è®¾ç½®serviceName的名称去大写I
                .setFileOverride(Override);// æ˜¯å¦è¦†ç›–已生成文件
                .setFileOverride(Override)
                .setEntityName("pojo");// æ˜¯å¦è¦†ç›–已生成文件
        mpg.setGlobalConfig(gc);
        // æ•°æ®æºé…ç½® æ•°æ®åº“名 è´¦å·å¯†ç 
sys/src/main/resources/application-dev.yml
@@ -19,6 +19,8 @@
# ç…§ç‰‡å­˜å‚¨è·¯å¾„+++++++++++++++++++++++++++运维需要配置+++++++++++++++++++++++++++
file:
  path: E:/webapp/images
  # ä¸Šä¼ æ–‡ä»¶å…è®¸çš„æ‰©å±•名
  allowed: png,jpg,jpeg,gif
# éµ·é›ç®¡ç†ç³»ç»Ÿå¯†é’¥
login:
sys/src/main/resources/application-prod.yml
@@ -19,6 +19,8 @@
# ç…§ç‰‡è·¯å¾„+++++++++++++++++++++++++++运维需要配置+++++++++++++++++++++++++++
file:
  path: /javaWork/LIMS/images
  # ä¸Šä¼ æ–‡ä»¶å…è®¸çš„æ‰©å±•名
  allowed: png,jpg,jpeg,gif
# éµ·é›ç½‘络IP或者域名+++++++++++++++++++++++++++运维需要配置+++++++++++++++++++++++++++
customer:
sys/src/main/resources/application.yml
@@ -1,6 +1,11 @@
server:
  port: 1234
spring:
  servlet:
    multipart:
      max-file-size: 20MB # å•个文件大小
      max-request-size: 1024MB # ä¸€æ¬¡è¯·æ±‚文件总大小
  profiles:
    active: dev
user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java
@@ -7,12 +7,9 @@
import com.yuanchu.limslaboratory.vo.NewPersonnelVo;
import com.yuanchu.limslaboratory.vo.PagePersonnelVo;
import com.yuanchu.limslaboratory.vo.UpdatePersonnelVo;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -73,4 +70,9 @@
     * @return
     */
    String selectByUserId(Integer userId);
    /**
     * èŽ·å–æ‰€æœ‰ç”¨æˆ·çš„åç§°ä¸ŽId
     */
    List<Map<String, Object>> getUserNameAndId();
}
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java
@@ -18,6 +18,7 @@
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@@ -74,6 +75,13 @@
    }
    @Override
    public List<Map<String, Object>> getUserNameAndId() {
        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
        wrapper.select(User::getId, User::getName);
        return userMapper.selectMaps(wrapper);
    }
    @Override
    public Map<String, String> selectUserByUserId(int userId) {
        return userMapper.selectUserByUserId(userId);
    }