已修改46个文件
已重命名2个文件
已删除4个文件
已添加10个文件
| | |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | |
| | | //设置æä»¶èæè·¯å¾æ å° |
| | | registry.addResourceHandler("/img/**").addResourceLocations("file:"+filePath+"/") |
| | | .addResourceLocations("file:"+filePath+"/"); |
| | | registry.addResourceHandler("/img/**").addResourceLocations("file:"+filePath+"/"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | @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) |
| | | { |
| | |
| | | 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) { |
| | |
| | | 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; |
| | | |
| | |
| | | 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; |
| | | // ç®å½ä¸åå¨åå建 |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | |
| | | List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state); |
| | | |
| | | int selectInspectToCount(Integer state); |
| | | |
| | | } |
| | |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "id", hidden = true) |
| | | private int id; |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "materialId") |
| | | private String materialId; |
| | |
| | | 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 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); |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | <?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"> |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | 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> |
| | |
| | | * @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("æ´æ°å类失败ï¼"); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | * @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("æ´æ°å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | * @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() + "ã失败! "); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | * @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()); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.yuanchu.limslaboratory.entity.Classify; |
| | | import com.yuanchu.limslaboratory.pojo.Classify; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface EquipmentPointMapper extends BaseMapper<EquipmentPoint> { |
| | | |
| | | List<Map<String, Object>> getListEquipmentPointInformation(); |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface InstrumentMapper extends BaseMapper<Instrument> { |
| | | |
| | | IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions,Boolean whetherWhether, String numberOrNameOrSpecifications, Integer classifyId, Page<Objects> page); |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface MetricalInformationMapper extends BaseMapper<MetricalInformation> { |
| | | |
| | | List<Map<String, Object>> getListEquipmentPointInformation(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface EquipmentPointService extends IService<EquipmentPoint> { |
| | | |
| | | Integer addEquipmentPointInformation(EquipmentPoint equipmentPoint); |
| | | |
| | | List<Map<String, Object>> getListEquipmentPointInformation(); |
| | | |
| | | Integer deleteEquipmentPointInformation(Integer equipmentPointId); |
| | | |
| | | Integer updateEquipmentPointInformation(EquipmentPoint equipmentPoint); |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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> |
| | |
| | | @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; |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | @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; |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | @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; |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | @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); |
| | | } |
| | | } |
| | |
| | | <!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> |
| | |
| | | <!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> |
| | |
| | | <!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> |
| | |
| | | |
| | | |
| | | 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; |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ ååº-->è§æ ¼-->æ¥ç-->ç¶->ç©æ") |
| | | @Api(tags = "æ ååº-->4ãè§æ ¼-->æ¥ç-->ç¶æ¨¡å") |
| | | @RestController |
| | | @RequestMapping("/material") |
| | | public class MaterialController { |
| | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @ApiOperation("ç©æåº-->æ·»å ç©æ") |
| | | @ApiOperation("æ·»å ç©æ") |
| | | @PostMapping("/add") |
| | | public Result<?> addMaterialInformation(@RequestBody Material material) { |
| | | Integer isMaterialSuccess = materialService.addMaterialInformation(material); |
| | |
| | | return Result.fail("æ·»å ç©æã"+ material.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("ç©æåº-->æ ¹æ®è§æ ¼IDæ¥è¯¢ææç©æ") |
| | | @ApiOperation("æ ¹æ®è§æ ¼IDæ¥è¯¢ææç©æ") |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "è§æ ¼ID", name = "specificationsId", dataTypeClass = String.class) |
| | |
| | | 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) |
| | |
| | | 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() +"ãæåï¼"); |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ ååº-->è§æ ¼-->æ¥ç-->ç¶-->å") |
| | | @Api(tags = "æ ååº-->5ãè§æ ¼-->æ¥ç-->忍¡å") |
| | | @RestController |
| | | @RequestMapping("/product") |
| | | public class ProductController { |
| | |
| | | @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); |
| | |
| | | return Result.fail("æ·»å ç©æã"+ product.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("ç©æåº-->æ ¹æ®ç©æIDæ¥è¯¢æææµè¯æ å") |
| | | @ApiOperation("æ ¹æ®ç©æIDæ¥è¯¢æææµè¯æ å") |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "ç©æID", name = "materialId", dataTypeClass = String.class) |
| | |
| | | return Result.success(listMaterialInformation); |
| | | } |
| | | |
| | | @ApiOperation("ç©æåº-->æ ¹æ®æµè¯æ åIDæ¥è¯¢åºæ¬ä¿¡æ¯") |
| | | @ApiOperation("æ ¹æ®æµè¯æ åIDæ¥è¯¢åºæ¬ä¿¡æ¯") |
| | | @GetMapping("/productId") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "æµè¯æ åID", name = "productId", dataTypeClass = String.class) |
| | |
| | | return Result.success(productInformation); |
| | | } |
| | | |
| | | @ApiOperation("ç©æåº-->å 餿µè¯æ 忍¡åæ°æ®") |
| | | @ApiOperation("å 餿µè¯æ 忍¡åæ°æ®") |
| | | @DeleteMapping("/delete") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "æµè¯æ åID", name = "productId", dataTypeClass = String.class) |
| | |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("ç©æåº-->æ ¹æ®æµè¯æ åIdä¿®æ¹æ°æ®") |
| | | @ApiOperation("æ ¹æ®æµè¯æ åIdä¿®æ¹æ°æ®") |
| | | @PutMapping("/update") |
| | | public Result<?> updateMaterialInformation(@RequestBody Product product) { |
| | | Integer isUpdateMaterialSuccess = productService.updateMaterialInformation(product); |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "æ ååº-->åå·") |
| | | @Api(tags = "æ ååº-->2ãåå·") |
| | | @RestController |
| | | @RequestMapping("/serial-number") |
| | | public class SerialNumberController { |
| | |
| | | @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); |
| | |
| | | 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), |
| | |
| | | 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); |
| | |
| | | return Result.fail("æ´æ°å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ååº-->æ ¹æ®Idå é¤åå·") |
| | | @ApiOperation("æ ¹æ®Idå é¤åå·") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteSerialNumberInformation(String serialNumberId) { |
| | | Integer isDeleteSerialNumberSuccess = serialNumberService.deleteSerialNumberInformation(serialNumberId); |
| | |
| | | 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; |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "æ ååº-->åå·-->产åè§æ ¼") |
| | | @Api(tags = "æ ååº-->3ãåå·-->产åè§æ ¼") |
| | | @RestController |
| | | @RequestMapping("/specifications") |
| | | public class SpecificationsController { |
| | |
| | | @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); |
| | |
| | | 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), |
| | |
| | | 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() +"ãæåï¼"); |
| | |
| | | return Result.fail("æ´æ°ã"+ specifications.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ååº-->产åè§æ ¼-->å é¤") |
| | | @ApiOperation("å é¤äº§åè§æ ¼") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "è§æ ¼Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | 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("æä½æåï¼"); |
| | | } |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "æ ååº-->âââ") |
| | | @Api(tags = "æ ååº-->1ãâââ") |
| | | @RestController |
| | | @RequestMapping("/standards") |
| | | public class StandardsController { |
| | |
| | | @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); |
| | |
| | | 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), |
| | |
| | | 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); |
| | |
| | | return Result.fail("æ´æ°å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ååº-->æ ¹æ®IDå 餿°æ®") |
| | | @ApiOperation("æ ¹æ®IDå 餿°æ®") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteStandardsInformation(String standardsId) { |
| | | Integer isDeleteSuccess = standardsService.deleteStandardsInformation(standardsId); |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "å
³è è§æ ¼id", example = "1", required = true) |
| | | private Integer specificationsId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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/vo/UpdateSpeStateSpecifications.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.limslaboratory.vo; |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @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/vo/UpdateSpecificationsInformation.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.limslaboratory.vo; |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="æ ååº-->è§æ ¼åå·-->ç¼è¾å¯¹è±¡", description="ç¨äºå¯¹è§æ ¼çæ´æ°") |
| | | public class UpdateSpecificationsInformation { |
| | | public class UpdateSpecificationsInformationDto { |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼id", example = "2", required = true) |
| | | private Integer id; |
| | |
| | | |
| | | 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; |
| | |
| | | * @param materialId |
| | | * @return |
| | | */ |
| | | Material ListIdMaterialInformation(String materialId); |
| | | Material ListIdMaterialInformation(String materialId) throws Exception; |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | |
| | | List<Integer> SerialNumberIdDeleteSpecifications(List<String> deleteSerialNumberId); |
| | | |
| | | Integer updateSpeStateSpecifications(UpdateSpeStateSpecifications updateSpeStateSpecifications); |
| | | Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |
| | |
| | | </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} |
| | |
| | | .setOpen(false) // æ¯å¦æå¼ |
| | | .setSwagger2(true) //å®ä½å±æ§ Swagger2 注解 |
| | | .setServiceName("%sService") // 设置serviceNameçåç§°å»å¤§åI |
| | | .setFileOverride(Override);// æ¯å¦è¦çå·²çææä»¶ |
| | | .setFileOverride(Override) |
| | | .setEntityName("pojo");// æ¯å¦è¦çå·²çææä»¶ |
| | | mpg.setGlobalConfig(gc); |
| | | |
| | | // æ°æ®æºé
ç½® æ°æ®åºå è´¦å·å¯ç |
| | |
| | | # ç
§çåå¨è·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é
ç½®+++++++++++++++++++++++++++ |
| | | file: |
| | | path: E:/webapp/images |
| | | # ä¸ä¼ æä»¶å
è®¸çæ©å±å |
| | | allowed: png,jpg,jpeg,gif |
| | | |
| | | # éµ·é管çç³»ç»å¯é¥ |
| | | login: |
| | |
| | | # ç
§çè·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é
ç½®+++++++++++++++++++++++++++ |
| | | file: |
| | | path: /javaWork/LIMS/images |
| | | # ä¸ä¼ æä»¶å
è®¸çæ©å±å |
| | | allowed: png,jpg,jpeg,gif |
| | | |
| | | # éµ·éç½ç»IPæè
åå+++++++++++++++++++++++++++è¿ç»´éè¦é
ç½®+++++++++++++++++++++++++++ |
| | | customer: |
| | |
| | | server: |
| | | port: 1234 |
| | | |
| | | spring: |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 20MB # å个æä»¶å¤§å° |
| | | max-request-size: 1024MB # 䏿¬¡è¯·æ±æä»¶æ»å¤§å° |
| | | profiles: |
| | | active: dev |
| | | |
| | |
| | | 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> |
| | |
| | | * @return |
| | | */ |
| | | String selectByUserId(Integer userId); |
| | | |
| | | /** |
| | | * è·åææç¨æ·çåç§°ä¸Id |
| | | */ |
| | | List<Map<String, Object>> getUserNameAndId(); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |