XiaoRuby
2023-07-19 2d44844cafa096bd42391b8d2c2185f0bfbf2d79
LIMS管理系统框架-开发7-19-v1.0.0
已修改31个文件
已删除1个文件
已添加1个文件
736 ■■■■ 文件已修改
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SerialNumberMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SpecificationsMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/StandardsMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Product.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Specifications.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SerialNumberService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SpecificationsService.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardsService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SerialNumberServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardsServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/vo/ListSpecificationsInformation.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/vo/UpdateSpecificationsInformation.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/ProductMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/SerialNumberMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/SpecificationsMapper.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/StandardsMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application-dev.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/test/java/com/yuanchu/limslaboratory/SysApplicationTests.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/clients/UserClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java
@@ -1,9 +1,20 @@
package com.yuanchu.limslaboratory.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.service.MaterialService;
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.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -13,8 +24,54 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "标准库-->规格-->查看-->父->物料")
@RestController
@RequestMapping("/material")
public class MaterialController {
    @Autowired
    private MaterialService materialService;
    @ApiOperation("物料库-->添加物料")
    @PostMapping("/add")
    public Result<?> addMaterialInformation(@RequestBody Material material) {
        Integer isMaterialSuccess = materialService.addMaterialInformation(material);
        if (isMaterialSuccess == 1) {
            return Result.success("添加物料【"+ material.getName() +"】成功!");
        }
        return Result.fail("添加物料【"+ material.getName() +"】失败!");
    }
    @ApiOperation("物料库-->根据规格ID查询所有物料")
    @GetMapping("/list")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "规格ID", name = "specificationsId", dataTypeClass = String.class)
    })
    public Result<?> getListMaterialInformation(String specificationsId) {
        List<Map<String, Object>> listMaterialInformation = materialService.getListMaterialInformation(specificationsId);
        return Result.success(listMaterialInformation);
    }
    @ApiOperation("物料库-->根据物料ID删除物料")
    @DeleteMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "物料ID", name = "materialId", dataTypeClass = String.class)
    })
    public Result<?> deleteMaterialInformation(Integer materialId) {
        Integer isDeleteMaterialSuccess = materialService.deleteMaterialInformation(materialId);
        if (isDeleteMaterialSuccess == 1) {
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
    @ApiOperation("物料库-->修改物料")
    @PutMapping("/update")
    public Result<?> updateMaterialInformation(@RequestBody Material material) {
        Integer isUpdateMaterialSuccess = materialService.updateMaterialInformation(material);
        if (isUpdateMaterialSuccess == 1) {
            return Result.success("修改物料【"+ material.getName() +"】成功!");
        }
        return Result.fail("修改物料【"+ material.getName() +"】失败!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java
@@ -1,15 +1,16 @@
package com.yuanchu.limslaboratory.controller;
import com.yuanchu.limslaboratory.pojo.SerialNumber;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.service.ProductService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@@ -20,6 +21,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "标准库-->规格-->查看-->父-->子")
@RestController
@RequestMapping("/product")
public class ProductController {
@@ -27,4 +29,63 @@
    @Autowired
    private ProductService productService;
    @ApiOperation("测试标准模块-->添加测试标准")
    @PostMapping("/add")
    public Result<?> addProductInformation(@RequestHeader("X-Token") String token, @RequestBody Product product) throws Exception {
        Object userMessage = RedisUtil.get(token);
        if (!ObjectUtils.isEmpty(userMessage)){
            Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(userMessage), Map.class);
            product.setUserId(Integer.parseInt(unmarshal.get("id").toString()));
        } else {
            return Result.fail("对不起,Token错误!");
        }
        Integer isProductSuccess = productService.addProductInformation(product);
        if (isProductSuccess == 1) {
            return Result.success("添加物料【"+ product.getName() +"】成功!");
        }
        return Result.fail("添加物料【"+ product.getName() +"】失败!");
    }
    @ApiOperation("物料库-->根据物料ID查询所有测试标准")
    @GetMapping("/list")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "物料ID", name = "materialId", dataTypeClass = String.class)
    })
    public Result<?> getListProductInformation(Integer materialId) {
        List<Map<String, Object>> listMaterialInformation = productService.getListProductInformation(materialId);
        return Result.success(listMaterialInformation);
    }
    @ApiOperation("物料库-->根据测试标准ID查询基本信息")
    @GetMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "测试标准ID", name = "productId", dataTypeClass = String.class)
    })
    public Result<?> getProductInformation(Integer productId) {
        Map<String, Object> productInformation = productService.getProductInformation(productId);
        return Result.success(productInformation);
    }
    @ApiOperation("物料库-->删除测试标准模块数据")
    @DeleteMapping("/delete")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "测试标准ID", name = "productId", dataTypeClass = String.class)
    })
    public Result<?> deleteProductInformation(Integer productId) {
        Integer isDeleteProduct = productService.deleteProductInformation(productId);
        if (isDeleteProduct == 1) {
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
//    @ApiOperation("物料库-->修改物料")
//    @PutMapping("/update")
//    public Result<?> updateMaterialInformation(@RequestBody Material material) {
//        Integer isUpdateMaterialSuccess = materialService.updateMaterialInformation(material);
//        if (isUpdateMaterialSuccess == 1) {
//            return Result.success("修改物料【"+ material.getName() +"】成功!");
//        }
//        return Result.fail("修改物料【"+ material.getName() +"】失败!");
//    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java
@@ -1,9 +1,12 @@
package com.yuanchu.limslaboratory.controller;
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.service.SerialNumberService;
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;
@@ -13,6 +16,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -24,7 +28,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->型号操作")
@Api(tags = "标准库-->型号")
@RestController
@RequestMapping("/serial-number")
public class SerialNumberController {
@@ -45,14 +49,19 @@
        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)
            @ApiImplicitParam(value = "型号/型号名称", name = "IdOrNameOfSerialNumber", dataTypeClass = String.class),
            @ApiImplicitParam(value = "标准号Id", name = "standardsId", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
    })
    @GetMapping("/list")
    public Result<?> listSerialNumberInformation(String IdOrNameOfSerialNumber, String standardsId){
        List<Map<String, Object>> selectStandards= serialNumberService.listSerialNumberInformation(IdOrNameOfSerialNumber,standardsId);
        return Result.success(selectStandards);
    public Result<?> listSerialNumberInformation(String IdOrNameOfSerialNumber, String standardsId, Integer pageNo, Integer pageSize){
        IPage<Map<String, Object>> selectStandards= serialNumberService.listSerialNumberInformation(IdOrNameOfSerialNumber,standardsId, new Page<Object>(pageNo, pageSize));
        Map<String, Object> map = new HashMap<>();
        map.put("row", selectStandards.getRecords());
        map.put("total", selectStandards.getTotal());
        return Result.success(map);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
@@ -4,22 +4,20 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.pojo.Standards;
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.ListSpecificationsInformation;
import com.yuanchu.limslaboratory.vo.Result;
import com.yuanchu.limslaboratory.vo.UpdateSpecificationsInformation;
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.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -31,7 +29,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->型号-->产品规格操作")
@Api(tags = "标准库-->型号-->产品规格")
@RestController
@RequestMapping("/specifications")
public class SpecificationsController {
@@ -57,17 +55,47 @@
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "specificationsName", value = "规格名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "serialNumberId", value = "型号ID", dataTypeClass = String.class),
            @ApiImplicitParam(name = "serialNumberId", value = "型号ID", dataTypeClass = String.class,required = true)
    })
    @GetMapping("/list")
    public Result<?> listSpecificationsInformation(Integer pageNo,
                                                   Integer pageSize,
                                                   String specificationsName,
                                                   String serialNumberId){
        IPage<ListSpecificationsInformation> pageList= specificationsService.listSpecificationsInformation(specificationsName,serialNumberId,new Page<Objects>(pageNo, pageSize));
        IPage<Map<String, Objects>> pageList= specificationsService.listSpecificationsInformation(specificationsName,serialNumberId,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("标准库-->产品规格-->编辑")
    @PutMapping("/update")
    public Result<?> updateSpecificationsInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateSpecificationsInformation updateSpecificationsInformation) 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);
        Integer isStandardsSuccess = specificationsService.updateSpecificationsInformation(specifications);
        if (isStandardsSuccess == 1) {
            return Result.success("更新【"+ specifications.getName() +"】成功!");
        }
        return Result.fail("更新【"+ specifications.getName() +"】失败!");
    }
    @ApiOperation("标准库-->产品规格-->删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "specificationsId", value = "规格Id", dataTypeClass = String.class, required = true)
    })
    @DeleteMapping("/delete")
    public Result<?> deleteSpecificationsInformation(String specificationsId) {
        Integer isStandardsSuccess = specificationsService.deleteSpecifications(specificationsId);
        if (isStandardsSuccess == 1) {
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java
@@ -2,6 +2,8 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Standards;
import com.yuanchu.limslaboratory.service.StandardsService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
@@ -13,10 +15,13 @@
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.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -26,7 +31,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库操作")
@Api(tags = "标准库-->⭐⭐⭐")
@RestController
@RequestMapping("/standards")
public class StandardsController {
@@ -38,6 +43,9 @@
    @PostMapping("/add")
    public Result<?> addStandardsInformation(@RequestHeader("X-Token") String token, @RequestBody Standards standards) 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);
        standards.setUserId((Integer) unmarshal.get("id"));
        Integer isStandardsSuccess = standardsService.addStandardsInformation(standards);
@@ -47,13 +55,25 @@
        return Result.fail("添加【"+ standards.getName() +"】失败!");
    }
    @ApiOperation("标准库-->点击全部:查询所有标准数据")
    @ApiOperation("标准库-->侧边栏查询所有标准数据")
    @GetMapping("/list")
    public Result<?> listStandardsInformation(){
        List<Map<String, Object>> list = standardsService.listStandardsInformation();
        return Result.success(list);
    }
    @ApiOperation("标准库-->点击全部:分页查询所有标准数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(value = "标准号/标准名称", name = "IdOrNameOfStandards", dataTypeClass = String.class)
    })
    @GetMapping("/list")
    public Result<?> listStandardsInformation(String IdOrNameOfStandards){
        List<Map<String, Object>> list = standardsService.listStandardsInformation(IdOrNameOfStandards);
        return Result.success(list);
    @GetMapping("/list_page")
    public Result<?> listPageStandardsInformation(Integer pageNo, Integer pageSize, String IdOrNameOfStandards){
        IPage<Map<String, Object>> listPage = standardsService.listPageStandardsInformation(new Page<Object>(pageNo, pageSize), IdOrNameOfStandards);
        Map<String, Object> map = new HashMap<>();
        map.put("row", listPage.getRecords());
        map.put("total", listPage.getTotal());
        return Result.success(map);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductMapper.java
@@ -3,6 +3,8 @@
import com.yuanchu.limslaboratory.pojo.Product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Map;
/**
 * <p>
 *  Mapper æŽ¥å£
@@ -13,4 +15,5 @@
 */
public interface ProductMapper extends BaseMapper<Product> {
    Map<String, Object> getProductInformation(Integer productId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SerialNumberMapper.java
@@ -1,5 +1,7 @@
package com.yuanchu.limslaboratory.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.SerialNumber;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -16,4 +18,5 @@
 */
public interface SerialNumberMapper extends BaseMapper<SerialNumber> {
    IPage<Map<String, Object>> listSerialNumberInformation(String idOrNameOfSerialNumber, String standardsId, Page<Object> page);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SpecificationsMapper.java
@@ -1,11 +1,9 @@
package com.yuanchu.limslaboratory.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanchu.limslaboratory.vo.ListSpecificationsInformation;
import java.util.Map;
import java.util.Objects;
@@ -20,5 +18,5 @@
 */
public interface SpecificationsMapper extends BaseMapper<Specifications> {
    IPage<ListSpecificationsInformation> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page);
    IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/StandardsMapper.java
@@ -1,5 +1,7 @@
package com.yuanchu.limslaboratory.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Standards;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -16,5 +18,5 @@
 */
public interface StandardsMapper extends BaseMapper<Standards> {
    List<Map<String, Object>> listStandardsInformation(String idOrNameOfStandards);
    IPage<Map<String, Object>> listPageStandardsInformation(Page<Object> page, String idOrNameOfStandards);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java
@@ -28,25 +28,25 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "物料id")
    @ApiModelProperty(value = "物料id", example = "152453211563212", required = true)
    private String id;
    @ApiModelProperty(value = "物料名称")
    @ApiModelProperty(value = "物料名称", example = "石头", required = true)
    private String name;
    @ApiModelProperty(value = "供应商")
    @ApiModelProperty(value = "供应商", example = "百度", required = true)
    private String supplier;
    @ApiModelProperty(value = "物料存放地")
    @ApiModelProperty(value = "物料存放地", example = "仓库一,二号架", required = true)
    private String location;
    @ApiModelProperty(value = "物料数量")
    @ApiModelProperty(value = "物料数量", example = "200", required = true)
    private Integer num;
    @ApiModelProperty(value = "批次")
    @ApiModelProperty(value = "批次", example = "1", required = true)
    private String batch;
    @ApiModelProperty(value = "盘号")
    @ApiModelProperty(value = "盘号", example = "152453211563212", required = true)
    private String reelNumber;
    @TableLogic(value = "1", delval = "0")
@@ -63,9 +63,10 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
    @ApiModelProperty(value = "关联 è§„æ ¼id")
    @ApiModelProperty(value = "关联 è§„æ ¼id", example = "1", required = true)
    private Integer specificationsId;
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Product.java
@@ -27,26 +27,26 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "项目id")
    @ApiModelProperty(value = "测试标准id", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "项目名称")
    @ApiModelProperty(value = "测试标准名称", example = "单位长度质量", required = true)
    private String name;
    @ApiModelProperty(value = "试验方法")
    @ApiModelProperty(value = "试验方法", example = "--", required = true)
    private String method;
    @ApiModelProperty(value = "项目父类")
    @ApiModelProperty(value = "测试标准父类", example = "铝包钢芯铝绞线")
    private String father;
    @ApiModelProperty(value = "单位")
    @ApiModelProperty(value = "单位", example = "km", required = true)
    private String unit;
    @ApiModelProperty(value = "招标人要求值")
    @ApiModelProperty(value = "招标人要求值", example = "<=0.3458", required = true)
    private String required;
    @ApiModelProperty(value = "内控值")
    @ApiModelProperty(value = "内控值", example = "<=0.3458", required = true)
    private String internal;
    @TableLogic(value = "1", delval = "0")
@@ -63,12 +63,13 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
    @ApiModelProperty(value = "关联 ç”¨æˆ·id")
    @ApiModelProperty(value = "关联 ç”¨æˆ·id", hidden = true)
    private Integer userId;
    @ApiModelProperty(value = "关联 ç‰©æ–™id")
    @ApiModelProperty(value = "关联 ç‰©æ–™id", example = "152453211563212", required = true)
    private String materialId;
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Specifications.java
@@ -32,7 +32,7 @@
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "规格id", example = "modelId", required = true)
    @ApiModelProperty(value = "规格编号", example = "modelId", required = true)
    private String number;
    @ApiModelProperty(value = "产品规格名称", example = "AB", required = true)
@@ -54,6 +54,7 @@
    private Integer spe_state;
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    @TableLogic(value = "1", delval = "0")
    private Integer state;
    @TableField(fill = FieldFill.INSERT)
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java
@@ -3,6 +3,9 @@
import com.yuanchu.limslaboratory.pojo.Material;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
 * <p>
 *  æœåŠ¡ç±»
@@ -13,4 +16,33 @@
 */
public interface MaterialService extends IService<Material> {
    Integer addMaterialInformation(Material material);
    /**
     * ä¾§è¾¹æ ç‰©æ–™æ•°æ®
     * @param specificationsId
     * @return
     */
    List<Map<String, Object>> getListMaterialInformation(String specificationsId);
    /**
     * åˆ é™¤ç­‰äºŽMaterialId的数据
     * @param materialId
     * @return
     */
    Integer deleteMaterialInformation(Integer materialId);
    /**
     * æ›´æ–°Material的数据
     * @param material
     * @return
     */
    Integer updateMaterialInformation(Material material);
    /**
     * åˆ é™¤ç­‰äºŽSpecificationId的数据
     * @param specificationsId
     * @return
     */
    List<String> deleteMaterialEqSpecification(String specificationsId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java
@@ -2,6 +2,10 @@
import com.yuanchu.limslaboratory.pojo.Product;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.models.auth.In;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -13,4 +17,13 @@
 */
public interface ProductService extends IService<Product> {
    Integer addProductInformation(Product product);
    List<Map<String, Object>> getListProductInformation(Integer materialId);
    Map<String, Object> getProductInformation(Integer productId);
    Integer deleteProductInformation(Integer productId);
    void deleteProductEqMaterialId(List<String> materialListId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SerialNumberService.java
@@ -1,5 +1,7 @@
package com.yuanchu.limslaboratory.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.SerialNumber;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -23,5 +25,12 @@
     */
    Integer addSerialNumberInformation(SerialNumber serialNumber);
    List<Map<String, Object>> listSerialNumberInformation(String idOrNameOfSerialNumber, String standardsId);
    IPage<Map<String, Object>> listSerialNumberInformation(String idOrNameOfSerialNumber, String standardsId, Page<Object> page);
    /**
     * æ ¹æ®æ ‡å‡†Id查询所有型号
     * @param id
     * @return
     */
    List<Map<String, Object>> selectIdSerialNumberInformation(String id);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SpecificationsService.java
@@ -4,7 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.limslaboratory.vo.ListSpecificationsInformation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
import java.util.Objects;
@@ -21,5 +21,15 @@
    Integer addSpecificationsInformation(Specifications specifications);
    IPage<ListSpecificationsInformation> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page);
    IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page);
    Integer updateSpecificationsInformation(Specifications specifications);
    /**
     * å¤šè¡¨åˆ é™¤ï¼Œè¡¨æ ¼åˆ†åˆ«æœ‰ï¼šSpecification --> Material --> Product
     * @param specificationsId
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    Integer deleteSpecifications(String specificationsId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardsService.java
@@ -1,5 +1,7 @@
package com.yuanchu.limslaboratory.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Standards;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -18,10 +20,12 @@
    Integer addStandardsInformation(Standards standards);
    List<Map<String, Object>> listStandardsInformation(String IdOrNameOfStandards);
    List<Map<String, Object>> listStandardsInformation();
    /**
     * æ ¹æ®Id查询是否存在该标准
     */
    Boolean standardsIsNull(String Id);
    IPage<Map<String, Object>> listPageStandardsInformation(Page<Object> page, String idOrNameOfStandards);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java
@@ -1,10 +1,19 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.mapper.MaterialMapper;
import com.yuanchu.limslaboratory.service.MaterialService;
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.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -17,4 +26,53 @@
@Service
public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService {
    @Resource
    private MaterialMapper materialMapper;
    @Override
    public Integer addMaterialInformation(Material material) {
        return materialMapper.insert(material);
    }
    @Override
    public List<Map<String, Object>> getListMaterialInformation(String specificationsId) {
        LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Material::getSpecificationsId, specificationsId);
        wrapper.select(Material::getId, Material::getName);
        return materialMapper.selectMaps(wrapper);
    }
    @Override
    public Integer deleteMaterialInformation(Integer materialId) {
        LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Material::getId, materialId);
        return materialMapper.delete(wrapper);
    }
    @Override
    public Integer updateMaterialInformation(Material material) {
        LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Material::getId, material.getId());
        materialMapper.updateById(material);
        return materialMapper.update(material, updateWrapper);
    }
    @Override
    public List<String> deleteMaterialEqSpecification(String specificationsId) {
        LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Material::getSpecificationsId, specificationsId);
        wrapper.select(Material::getId);
        List<Material> materials = materialMapper.selectList(wrapper);
        if (!ObjectUtils.isEmpty(materials)){
            List<String> list = new ArrayList<>();
            for (Material material:materials){
                list.add(material.getId());
            }
            int isDeleteList = materialMapper.deleteBatchIds(list);
            if (isDeleteList != 0) {
                return list;
            }
        }
        return null;
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java
@@ -1,10 +1,20 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.mapper.ProductMapper;
import com.yuanchu.limslaboratory.service.ProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -17,4 +27,69 @@
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
    @Resource
    private ProductMapper productMapper;
    @Autowired
    private UserService userService;
    @Override
    public Integer addProductInformation(Product product) {
        return productMapper.insert(product);
    }
    @Override
    public List<Map<String, Object>> getListProductInformation(Integer materialId) {
        LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Product::getMaterialId, materialId);
        wrapper.select(Product::getId, Product::getName, Product::getFather);
        wrapper.groupBy(Product::getFather);
        List<Map<String, Object>> products = productMapper.selectMaps(wrapper);
        for (Map<String, Object> product:products){
            if (!ObjectUtils.isEmpty(product.get("father"))){
                product.remove("name");
                product.remove("id");
                LambdaQueryWrapper<Product> wrapper1 = new LambdaQueryWrapper<>();
                wrapper1.eq(Product::getFather, product.get("father"));
                wrapper1.select(Product::getId, Product::getName);
                List<Map<String, Object>> maps = productMapper.selectMaps(wrapper1);
                product.put("sonProduct", maps);
            }
        }
        for (Map<String, Object> product:products){
            System.out.println(product);
        }
        return products;
    }
    @Override
    public Map<String, Object> getProductInformation(Integer productId) {
        Map<String, Object> productMap = productMapper.getProductInformation(productId);
        String userName = userService.selectByUserId((Integer) productMap.get("user_id"));
        productMap.remove("user_id");
        productMap.put("userName", userName);
        return productMap;
    }
    @Override
    public Integer deleteProductInformation(Integer productId) {
        LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Product::getId, productId);
        return productMapper.delete(wrapper);
    }
    @Override
    public void deleteProductEqMaterialId(List<String> materialListId) {
        for (String materialId : materialListId){
            LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(Product::getMaterialId, materialId);
            wrapper.select(Product::getId);
            List<Product> products = productMapper.selectList(wrapper);
            List<Integer> productDeleteId = new ArrayList<>();
            for (Product product : products){
                productDeleteId.add(product.getId());
            }
            productMapper.deleteBatchIds(productDeleteId);
        }
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SerialNumberServiceImpl.java
@@ -1,12 +1,15 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.mapper.SerialNumberMapper;
import com.yuanchu.limslaboratory.service.SerialNumberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.service.StandardsService;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -50,12 +53,15 @@
    @Override
    public List<Map<String, Object>> listSerialNumberInformation(String idOrNameOfSerialNumber, String standardsId) {
    public IPage<Map<String, Object>> listSerialNumberInformation(String idOrNameOfSerialNumber, String standardsId, Page<Object> page) {
        return serialNumberMapper.listSerialNumberInformation(idOrNameOfSerialNumber, standardsId, page);
    }
    @Override
    public List<Map<String, Object>> selectIdSerialNumberInformation(String id) {
        LambdaQueryWrapper<SerialNumber> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(SerialNumber::getStandardsId, standardsId);
        wrapper.like(SerialNumber::getId, idOrNameOfSerialNumber);
        wrapper.or().like(SerialNumber::getName, idOrNameOfSerialNumber);
        wrapper.select(SerialNumber::getId, SerialNumber::getName);
        wrapper.eq(SerialNumber::getStandardsId, id);
        wrapper.select(SerialNumber::getId,SerialNumber::getName);
        return serialNumberMapper.selectMaps(wrapper);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java
@@ -5,16 +5,15 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.mapper.SpecificationsMapper;
import com.yuanchu.limslaboratory.service.SpecificationsService;
import com.yuanchu.limslaboratory.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.service.StandardsService;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.vo.ListSpecificationsInformation;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
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;
@@ -38,6 +37,12 @@
    @Autowired
    private UserService userService;
    @Autowired
    private MaterialService materialService;
    @Autowired
    private ProductService productService;
    @Override
    public Integer addSpecificationsInformation(Specifications specifications) {
        Boolean userIsNull = userService.userIsNull(specifications.getUserId());
@@ -56,7 +61,32 @@
    }
    @Override
    public IPage<ListSpecificationsInformation> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page) {
    public IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page) {
        return specificationsMapper.listSpecificationsInformation(specificationsName,serialNumberId,page);
    }
    @Override
    public Integer updateSpecificationsInformation(Specifications specifications) {
        LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Specifications::getId, specifications.getId());
        return specificationsMapper.update(specifications, wrapper);
    }
    @Override
    public Integer deleteSpecifications(String specificationsId) {
        LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Specifications::getId, specificationsId);
        // åˆ é™¤Specifications中的数据
        int delete = specificationsMapper.delete(wrapper);
        if (delete == 1){
            // åˆ é™¤ç­‰äºŽSpecificationsId的Material表格中的数据,并且获取该数据的Id,用于删除Product表格中的数据
            List<String> materialListId = materialService.deleteMaterialEqSpecification(specificationsId);
            if (!ObjectUtils.isEmpty(materialListId)){
                // æ ¹æ®Material表返回的列表Id,删除Product表中所有MaterialId等于该列表中的所有数据,无返回值
                productService.deleteProductEqMaterialId(materialListId);
            }
            return 1;
        }
        return 0;
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardsServiceImpl.java
@@ -1,14 +1,18 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.Standards;
import com.yuanchu.limslaboratory.mapper.StandardsMapper;
import com.yuanchu.limslaboratory.pojo.User;
import com.yuanchu.limslaboratory.service.SerialNumberService;
import com.yuanchu.limslaboratory.service.StandardsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -33,6 +37,10 @@
    @Autowired
    private UserService userService;
    @Lazy
    @Autowired
    private SerialNumberService serialNumberService;
    @Override
    public Integer addStandardsInformation(Standards standards) {
        Boolean userIsNull = userService.userIsNull(standards.getUserId());
@@ -43,8 +51,20 @@
    }
    @Override
    public List<Map<String, Object>>  listStandardsInformation(String IdOrNameOfStandards) {
        return standardsMapper.listStandardsInformation(IdOrNameOfStandards);
    public List<Map<String, Object>> listStandardsInformation() {
        LambdaQueryWrapper<Standards> wrapper = new LambdaQueryWrapper<>();
        wrapper.select(Standards::getId, Standards::getName);
        List<Map<String, Object>> maps = standardsMapper.selectMaps(wrapper);
        for (Map<String, Object> map : maps){
            String id = map.get("id").toString();
            List<Map<String, Object>> serialNumberList = serialNumberService.selectIdSerialNumberInformation(id);
            if (ObjectUtils.isEmpty(serialNumberList)){
                map.put("serialNumber", null);
            } else {
                map.put("serialNumber", serialNumberList);
            }
        }
        return maps;
    }
    @Override
@@ -54,4 +74,9 @@
        Standards standardsIsNull = standardsMapper.selectOne(wrapper);
        return !ObjectUtils.isEmpty(standardsIsNull);
    }
    @Override
    public IPage<Map<String, Object>> listPageStandardsInformation(Page<Object> page, String idOrNameOfStandards) {
        return standardsMapper.listPageStandardsInformation(page, idOrNameOfStandards);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/vo/ListSpecificationsInformation.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/vo/UpdateSpecificationsInformation.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
package com.yuanchu.limslaboratory.vo;
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 UpdateSpecificationsInformation {
    @ApiModelProperty(value = "规格id", example = "2", required = true)
    private Integer id;
    @ApiModelProperty(value = "规格编号", example = "modelId", required = true)
    private String number;
    @ApiModelProperty(value = "产品规格名称", example = "AB", required = true)
    private String name;
    @ApiModelProperty(value = "生产指令号", example = "test", required = true)
    private String instruct;
    @ApiModelProperty(value = "电压等级", example = "test", required = true)
    private String voltageLevel;
    @ApiModelProperty(value = "主线心截面", example = "test", required = true)
    private String crossSection;
    @ApiModelProperty(value = "主线芯芯数", example = "test", required = true)
    private String numberOfCores;
    @ApiModelProperty(value = "规格状态 0:停用;1:正常;-1:草稿", example = "1", required = true)
    private Integer spe_state;
    @ApiModelProperty(value = "关联字段 åž‹å·id", example = "230711000002", required = true)
    private String serialId;
    @ApiModelProperty(value = "关联字段 ç”¨æˆ·id", hidden = true)
    private Integer userId;
}
standard-server/src/main/resources/mapper/ProductMapper.xml
@@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.ProductMapper">
    <select id="getProductInformation" parameterType="integer" resultType="map">
        SELECT p.method, ifnull(null, p.father) projectClassification, p.user_id, date_format(p.update_time, '%Y-%m-%d %H:%i:%s') updateTime,
               p.unit, p.required, p.internal
        FROM product p
        where p.id = #{productId}
    </select>
</mapper>
standard-server/src/main/resources/mapper/SerialNumberMapper.xml
@@ -2,4 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.SerialNumberMapper">
    <select id="listSerialNumberInformation" resultType="map">
        SELECT s.`id`, s.`name`
        FROM serial_number s
        WHERE s.`standards_id` = #{standardsId}
           <if test="idOrNameOfSerialNumber != null">
               OR s.`name` LIKE concat('%',#{idOrNameOfSerialNumber},'%')
               OR s.`id` LIKE concat('%',#{idOrNameOfSerialNumber},'%')
           </if>
    </select>
</mapper>
standard-server/src/main/resources/mapper/SpecificationsMapper.xml
@@ -2,20 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.SpecificationsMapper">
    <resultMap id="listSpecificationsInformationMap" type="com.yuanchu.limslaboratory.vo.ListSpecificationsInformation">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="updateTime" column="update_time"/>
        <result property="username" column="username"/>
        <result property="vel" column="vel"/>
        <result property="spe_state" column="spe_state"/>
    </resultMap>
    <select id="listSpecificationsInformation" resultMap="listSpecificationsInformationMap">
        SELECT s.`id`,s.`name`,s.`update_time`,u.`name` username,s.`vel`,s.`spe_state`
    <select id="listSpecificationsInformation" resultType="map">
        SELECT s.`id`,s.`name`,DATE_FORMAT(s.`update_time`, '%Y-%m-%d %H:%i') updateTime,u.`name` username,s.`vel`,s.`spe_state`
        FROM specifications s,`user` u
        WHERE s.`user_id` = u.`id`
            AND s.`number` = #{serialNumberId}
            AND s.`serial_id` = #{serialNumberId}
        <if test="specificationsName != null">
            AND s.`name` = #{specificationsName}
        </if>
standard-server/src/main/resources/mapper/StandardsMapper.xml
@@ -2,12 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.StandardsMapper">
    <select id="listStandardsInformation" resultType="Map">
    <select id="listPageStandardsInformation" resultType="Map">
        SELECT s.`id`, s.`name`, s.`eng_name`, DATE_FORMAT(s.`create_time`, '%Y-%m-%d %H:%i') createTime
        FROM standards s
        <if test="idOrNameOfStandards != null">
            WHERE s.`id` LIKE concat('%',#{idOrNameOfStandards},'%')
               OR s.name LIKE concat('%',#{idOrNameOfStandards},'%')
            OR s.name LIKE concat('%',#{idOrNameOfStandards},'%')
        </if>
    </select>
</mapper>
sys/src/main/resources/application-dev.yml
@@ -27,7 +27,7 @@
# éµ·é›ç½‘络IP或者域名
customer:
  url: http://127.0.0.1:6789
  url: http://114.132.189.42:8011
mybatis-plus:
  configuration:
@@ -69,7 +69,7 @@
    # redis访问密码(默认为空)
    password: null
    # redis连接超时时间(单位毫秒)
    timeout: 0
    timeout: 5000
    # redis连接池配置
    pool:
      # æœ€å¤§å¯ç”¨è¿žæŽ¥æ•°ï¼ˆé»˜è®¤ä¸º8,负数表示无限)
sys/src/test/java/com/yuanchu/limslaboratory/SysApplicationTests.java
@@ -1,17 +1,26 @@
package com.yuanchu.limslaboratory;
import com.yuanchu.limslaboratory.service.SerialNumberService;
import com.yuanchu.limslaboratory.utils.MyUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.text.NumberFormat;
import java.util.List;
import java.util.Map;
@SpringBootTest
class SysApplicationTests {
    @Autowired
    private SerialNumberService serialNumberService;
    @Test
    void contextLoads() {
        List<Map<String, Object>> maps = serialNumberService.listSerialNumberInformation(null, "230711000002");
        MyUtil.PrintLog(maps.toString());
    }
}
user-server/src/main/java/com/yuanchu/limslaboratory/clients/UserClient.java
@@ -8,7 +8,7 @@
import java.util.Map;
@FeignClient(value = "userservice", url = "localhost:6789")
@FeignClient(value = "userservice", url = "${customer.url}")
public interface UserClient {
    @PostMapping("/business/login")
user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java
@@ -23,21 +23,54 @@
 * @since 2023-07-07
 */
public interface UserService extends IService<User> {
//    é€šè¿‡ç”¨æˆ·id获取用户信息
    /**
     * é€šè¿‡ç”¨æˆ·id获取用户信息
     * @param userId
     * @return
     */
    Map<String, String> selectUserByUserId(int userId);
    User AccordingUsernameSelectAll(String account);
    /**
     * æ·»åŠ ç”¨æˆ·
     * @param newPersonnelVo
     * @param enterpriseId
     * @return
     */
    Integer addNewPersonnel(NewPersonnelVo newPersonnelVo, String enterpriseId);
    /**
     * æ›´æ–°ç”¨æˆ·åŸºæœ¬ä¿¡æ¯
     * @param updatePersonnelVo
     * @return
     */
    Integer updateNewPersonnel(UpdatePersonnelVo updatePersonnelVo);
    /**
     * åˆ†é¡µæŸ¥è¯¢æ‰€æœ‰ç”¨æˆ·ä¿¡æ¯
     * @param name
     * @param page
     * @return
     */
    IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page);
    /**
     * ç™»å½•获取用户基本信息与系统超时时间提醒
     * @param token
     * @return
     */
    Map<String, Object> getUserInfo(String token);
    /**
     * æ ¹æ®Id查询是否存在该用户
     */
    Boolean userIsNull(Integer Id);
    /**
     * æ ¹æ®ç”¨æˆ·Id查询用户名称
     * @param userId ç”¨æˆ·Id
     * @return
     */
    String selectByUserId(Integer userId);
}
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java
@@ -65,6 +65,15 @@
    }
    @Override
    public String selectByUserId(Integer userId) {
        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(User::getId, userId);
        wrapper.select(User::getName);
        User user = userMapper.selectOne(wrapper);
        return user.getName();
    }
    @Override
    public Map<String, String> selectUserByUserId(int userId) {
        return userMapper.selectUserByUserId(userId);
    }