XiaoRuby
2023-07-26 cdaff9ab0d1b676e3b429171d6de0887c98f488c
LIMS管理系统框架-开发7-26标准库修改前
已修改16个文件
已重命名2个文件
已删除13个文件
已添加4个文件
1354 ■■■■ 文件已修改
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardController.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SerialNumberMapper.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/StandardMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Product.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/SerialNumber.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Specifications.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Standard.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateMaterialInformation.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpeStateSpecificationsDto.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpecificationsInformationDto.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SerialNumberService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SpecificationsService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardsService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SerialNumberServiceImpl.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardServiceImpl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardsServiceImpl.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/MaterialMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/ProductMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/SerialNumberMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/SpecificationsMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/StandardMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/StandardsMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java
@@ -53,7 +53,6 @@
        list.forEach(a-> {
            InspectionProductList inspectionProductList = new InspectionProductList();
            inspectionProductList.setName(a.getName())
                    .setMethod(a.getMethod())
                    .setUnit(a.getUnit())
                    .setRequired(a.getRequired())
                    .setInternal(a.getInternal())
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java
@@ -2,10 +2,7 @@
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation;
import com.yuanchu.limslaboratory.service.MaterialService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -13,9 +10,6 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -25,7 +19,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "标准库-->4、规格-->查看-->父模块")
@Api(tags = "标准库-->1、物料")
@RestController
@RequestMapping("/material")
public class MaterialController {
@@ -36,31 +30,11 @@
    @ApiOperation("添加物料")
    @PostMapping("/add")
    public Result<?> addMaterialInformation(@RequestBody Material material) {
        Integer isMaterialSuccess = materialService.addMaterialInformation(material);
        Integer isMaterialSuccess = null;
        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查询物料详情")
    @GetMapping("/list_id")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "物料ID", name = "materialId", dataTypeClass = String.class)
    })
    public Result<?> getListIdMaterialInformation(String materialId) throws Exception {
        Material listIdMaterialInformation = materialService.ListIdMaterialInformation(materialId);
        return Result.success(listIdMaterialInformation);
    }
    @ApiOperation("根据物料ID删除物料")
@@ -74,16 +48,5 @@
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
    @ApiOperation("修改物料")
    @PutMapping("/update")
    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() +"】成功!");
        }
        return Result.fail("修改物料【"+ material.getName() +"】失败!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java
@@ -21,50 +21,13 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "标准库-->5、规格-->查看-->子模块")
@Api(tags = "标准库-->4、项目")
@RestController
@RequestMapping("/product")
public class ProductController {
    @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(String materialId) {
        List<Map<String, Object>> listMaterialInformation = productService.getListProductInformation(materialId);
        return Result.success(listMaterialInformation);
    }
    @ApiOperation("根据测试标准ID查询基本信息")
    @GetMapping("/productId")
    @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")
@@ -77,15 +40,5 @@
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
    @ApiOperation("根据测试标准Id修改数据")
    @PutMapping("/update")
    public Result<?> updateMaterialInformation(@RequestBody Product product) {
        Integer isUpdateMaterialSuccess = productService.updateMaterialInformation(product);
        if (isUpdateMaterialSuccess == 1) {
            return Result.success("修改【"+ product.getName() +"】成功!");
        }
        return Result.fail("修改【"+ product.getName() +"】失败!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
@@ -1,26 +1,14 @@
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.Specifications;
import com.yuanchu.limslaboratory.service.SpecificationsService;
import com.yuanchu.limslaboratory.utils.JackSonUtil;
import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
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;
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.Map;
import java.util.Objects;
/**
 * <p>
@@ -30,62 +18,13 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->3、型号-->产品规格")
@Api(tags = "标准库-->3、产品规格")
@RestController
@RequestMapping("/specifications")
public class SpecificationsController {
    @Autowired
    private SpecificationsService specificationsService;
    @ApiOperation("添加产品规格")
    @PostMapping("/add")
    public Result<?> addSpecificationsInformation(@RequestHeader("X-Token") String token,@RequestBody Specifications specifications) throws Exception {
        Object object = RedisUtil.get(token);
        Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
        specifications.setUserId((Integer) unmarshal.get("id"));
        Integer isStandardsSuccess = specificationsService.addSpecificationsInformation(specifications);
        if (isStandardsSuccess == 1) {
            return Result.success("添加【"+ specifications.getName() +"】成功!");
        }
        return Result.fail("添加【"+ specifications.getName() +"】失败!");
    }
    @ApiOperation("根据型号查询产品规格")
    @ApiImplicitParams(value = {
            @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,required = true)
    })
    @GetMapping("/list")
    public Result<?> listSpecificationsInformation(Integer pageNo,
                                                   Integer pageSize,
                                                   String specificationsName,
                                                   String serialNumberId){
        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 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);
        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("删除产品规格")
    @ApiImplicitParams(value = {
@@ -98,15 +37,5 @@
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
    @ApiOperation("更新规格状态")
    @PutMapping("/update_spe_state")
    public Result<?> updateSpeStateSpecifications(@RequestBody UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) {
        Integer isStandardsSuccess = specificationsService.updateSpeStateSpecifications(updateSpeStateSpecificationsDto);
        if (isStandardsSuccess == 1) {
            return Result.success("操作成功!");
        }
        return Result.fail("操作失败!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.yuanchu.limslaboratory.controller;
import com.yuanchu.limslaboratory.service.StandardService;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
 *  å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Api(tags = "标准库-->2、标准")
@RestController
@RequestMapping("/standards")
public class StandardController {
    @Autowired
    private StandardService standardService;
    @ApiOperation("根据ID删除数据")
    @DeleteMapping("/delete")
    public Result<?> deleteStandardsInformation(String standardsId) {
        Integer isDeleteSuccess = standardService.deleteStandardsInformation(standardsId);
        if (isDeleteSuccess == 1){
            return Result.success("删除成功!");
        }
        return Result.fail("删除失败!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SerialNumberMapper.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/StandardMapper.java
ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/StandardsMapper.java ÐÞ¸Ä
@@ -2,10 +2,9 @@
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.pojo.Standard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
@@ -16,7 +15,7 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
public interface StandardsMapper extends BaseMapper<Standards> {
public interface StandardMapper extends BaseMapper<Standard> {
    IPage<Map<String, Object>> listPageStandardsInformation(Page<Object> page, String idOrNameOfStandards);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java
@@ -4,9 +4,7 @@
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -29,26 +27,18 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "物料id", example = "152453211563212", required = true)
    @ApiModelProperty(value = "物料id", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private String id;
    @ApiModelProperty(value = "物料编码", example = "152453211563212", required = true)
    private String code;
    @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;
    @ApiModelProperty(value = "0:原材料;1:成品;2:半成品", example = "1", required = true)
    private Integer type;
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
@@ -66,8 +56,4 @@
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
    @ApiModelProperty(value = "关联 è§„æ ¼id", example = "1", required = true)
    private Integer specificationsId;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Product.java
@@ -34,16 +34,13 @@
    @ApiModelProperty(value = "测试标准名称", example = "单位长度质量", required = true)
    private String name;
    @ApiModelProperty(value = "试验方法", example = "--", required = true)
    private String method;
    @ApiModelProperty(value = "测试标准父类", example = "铝包钢芯铝绞线")
    private String father;
    @ApiModelProperty(value = "单位", example = "km", required = true)
    private String unit;
    @ApiModelProperty(value = "招标人要求值", example = "<=0.3458", required = true)
    @ApiModelProperty(value = "标准值", example = "<=0.3458", required = true)
    private String required;
    @ApiModelProperty(value = "内控值", example = "<=0.3458", required = true)
@@ -66,11 +63,8 @@
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
    @ApiModelProperty(value = "关联 ç”¨æˆ·id", hidden = true)
    private Integer userId;
    @ApiModelProperty(value = "关联 ç‰©æ–™id", example = "152453211563212", required = true)
    private String materialId;
    @ApiModelProperty(value = "关联 ç‰©æ–™id", example = "1", hidden = true)
    private Integer specifications_id;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/SerialNumber.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Specifications.java
@@ -32,26 +32,8 @@
    @TableId(value = "id", type = IdType.AUTO)
    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:草稿", hidden = true)
    private Integer spe_state;
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    @TableLogic(value = "1", delval = "0")
@@ -71,13 +53,7 @@
    @Version
    private Integer version;
    @ApiModelProperty(value = "关联字段 åž‹å·id", hidden = true)
    private String vel;
    @ApiModelProperty(value = "关联字段 åž‹å·id", example = "230711000002", required = true)
    private String serialId;
    @ApiModelProperty(value = "关联字段 ç”¨æˆ·id", hidden = true)
    private Integer userId;
    private Integer standardId;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Standard.java
ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Standards.java ÐÞ¸Ä
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
@@ -23,22 +22,16 @@
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Standards对象", description="标准")
public class Standards implements Serializable {
public class Standard implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "标准编号 yyMMdd000001(000001++)", example = "230711000001", required = true)
    @TableId(value = "id", type = IdType.INPUT)
    private String id;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "标准名称", example = "光纤", required = true)
    private String name;
    @ApiModelProperty(value = "英文名称", example = "OpticalFibre", required = true)
    private String engName;
    @ApiModelProperty(value = "0:原材料;1:电线电缆", example = "1", required = true)
    private Integer type;
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
@@ -58,8 +51,7 @@
    @Version
    private Integer version;
    @ApiModelProperty(value = "关联字段 æ›´æ–°äººid", hidden = true)
    private Integer userId;
    @ApiModelProperty(value = "物料Id", hidden = true)
    private Integer materialId;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateMaterialInformation.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpeStateSpecificationsDto.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/UpdateSpecificationsInformationDto.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java
@@ -2,7 +2,6 @@
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;
@@ -16,16 +15,10 @@
 * @since 2023-07-17
 */
public interface MaterialService extends IService<Material> {
    List<Material> selectMaterialLimit(int pageSize,int countSize);
    Integer addMaterialInformation(Material material);
    /**
     * ä¾§è¾¹æ ç‰©æ–™æ•°æ®
     * @param specificationsId
     * @return
     */
    List<Map<String, Object>> getListMaterialInformation(String specificationsId);
    Map selectMaterialById(String materialId);
    /**
     * åˆ é™¤ç­‰äºŽMaterialId的数据
@@ -35,25 +28,9 @@
    Integer deleteMaterialInformation(String materialId);
    /**
     * æ›´æ–°Material的数据
     * @param material
     * @return
     */
    Integer updateMaterialInformation(Material material);
    /**
     * åˆ é™¤ç­‰äºŽSpecificationsId的物料数据
     * @param deleteSpecificationsId
     * @return
     */
    List<String> specificationsIdDeleteMaterial(List<Integer> deleteSpecificationsId);
    Map selectMaterialById(String materialId);
    /**
     * æ ¹æ®Id查询规格详情
     * @param materialId
     * @return
     */
    Material ListIdMaterialInformation(String materialId) throws Exception;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java
@@ -16,19 +16,7 @@
 * @since 2023-07-17
 */
public interface ProductService extends IService<Product> {
    /*通过物料id获取物料信及下属的项目列表*/
    List<Product> selectProductByMaterialId(String materialId);
    Integer addProductInformation(Product product);
    List<Map<String, Object>> getListProductInformation(String materialId);
    Map<String, Object> getProductInformation(Integer productId);
    Integer deleteProductInformation(Integer productId);
    void MaterialIdDeleteProduct(List<String> deleteMaterialId);
    Integer updateMaterialInformation(Product product);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SerialNumberService.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/service/SpecificationsService.java
@@ -1,15 +1,10 @@
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.Specifications;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -20,15 +15,6 @@
 * @since 2023-07-11
 */
public interface SpecificationsService extends IService<Specifications> {
    Integer addSpecificationsInformation(Specifications specifications);
    Map<String,Object> selectSNameSNName(int materialId);
    IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page);
    Integer updateSpecificationsInformation(Specifications specifications);
    /**
     * å¤šè¡¨åˆ é™¤ï¼Œè¡¨æ ¼åˆ†åˆ«æœ‰ï¼šSpecification --> Material --> Product
     * @param specificationsId
@@ -38,6 +24,4 @@
    Integer deleteSpecifications(Integer specificationsId);
    List<Integer> SerialNumberIdDeleteSpecifications(List<String> deleteSerialNumberId);
    Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.pojo.Standard;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;
/**
 * <p>
 *  æœåŠ¡ç±»
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
public interface StandardService extends IService<Standard> {
    /**
     * æ ¹æ®æ ‡å‡†Id删除数据
     * @param standardsId
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    Integer deleteStandardsInformation(String standardsId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardsService.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java
@@ -4,17 +4,11 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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 org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
@@ -45,30 +39,8 @@
        return materialMapper.selectMaterialById(materialId);
    }
    @Override
    public Material ListIdMaterialInformation(String materialId) {
        LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Material::getId, materialId);
        wrapper.select(Material::getId, Material::getName, Material::getSupplier, Material::getLocation, Material::getNum, Material::getBatch,
                Material::getReelNumber);
        return materialMapper.selectOne(wrapper);
    }
    @Autowired
    private ProductService productService;
    @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(String materialId) {
@@ -86,19 +58,10 @@
    }
    @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> specificationsIdDeleteMaterial(List<Integer> deleteSpecificationsId) {
        List<String> list = new ArrayList<>();
        for (Integer serialNumberId:deleteSpecificationsId){
            LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(Material::getSpecificationsId, serialNumberId);
            wrapper.select(Material::getId);
            List<Material> maps1 = materialMapper.selectList(wrapper);
            for (Material material:maps1){
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java
@@ -31,52 +31,6 @@
    private ProductMapper productMapper;
    @Override
    public List<Product> selectProductByMaterialId(String materialId) {
        return productMapper.selectProductByMaterialId(materialId);
    }
    @Autowired
    private UserService userService;
    @Override
    public Integer addProductInformation(Product product) {
        return productMapper.insert(product);
    }
    @Override
    public List<Map<String, Object>> getListProductInformation(String 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) {
        LambdaUpdateWrapper<Product> wrapper = new LambdaUpdateWrapper<>();
        wrapper.eq(Product::getId, productId);
@@ -88,16 +42,9 @@
    public void MaterialIdDeleteProduct(List<String> deleteMaterialId) {
        for (String materialId : deleteMaterialId){
            LambdaUpdateWrapper<Product> wrapper = new LambdaUpdateWrapper<>();
            wrapper.eq(Product::getMaterialId, materialId);
            wrapper.eq(Product::getId, materialId);
            wrapper.set(Product::getState, 0);
            productMapper.update(new Product(), wrapper);
        }
    }
    @Override
    public Integer updateMaterialInformation(Product product) {
        LambdaUpdateWrapper<Product> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Product::getId, product.getId());
        return productMapper.update(product, updateWrapper);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SerialNumberServiceImpl.java
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java
@@ -2,13 +2,10 @@
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.Specifications;
import com.yuanchu.limslaboratory.mapper.SpecificationsMapper;
import com.yuanchu.limslaboratory.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -16,8 +13,6 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * <p>
@@ -34,50 +29,10 @@
    private SpecificationsMapper specificationsMapper;
    @Autowired
    private StandardsService standardsService;
    @Autowired
    private UserService userService;
    @Autowired
    private MaterialService materialService;
    @Autowired
    private ProductService productService;
    @Override
    public Integer addSpecificationsInformation(Specifications specifications) {
        Boolean userIsNull = userService.userIsNull(specifications.getUserId());
        if (userIsNull){
            Boolean standardsIsNull = standardsService.standardsIsNull(specifications.getSerialId());
            if (!ObjectUtils.isEmpty(standardsIsNull)){
                LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>();
                wrapper.eq(Specifications::getNumber, specifications.getNumber());
                Specifications specificationsNumberIsNull = specificationsMapper.selectOne(wrapper);
                if (ObjectUtils.isEmpty(specificationsNumberIsNull)){
                    return specificationsMapper.insert(specifications);
                }
            }
        }
        return 0;
    }
    @Override
    public IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page) {
        return specificationsMapper.listSpecificationsInformation(specificationsName,serialNumberId,page);
    }
    @Override
    public Map<String, Object> selectSNameSNName(int materialId) {
        return specificationsMapper.selectSNameSNName(materialId);
    }
    @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(Integer specificationsId) {
@@ -102,7 +57,7 @@
        List<Integer> list = new ArrayList<>();
        for (String serialNumberId:deleteSerialNumberId){
            LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(Specifications::getSerialId, serialNumberId);
            wrapper.eq(Specifications::getId, serialNumberId);
            wrapper.select(Specifications::getId);
            List<Specifications> maps1 = specificationsMapper.selectList(wrapper);
            for (Specifications specifications:maps1){
@@ -114,13 +69,5 @@
            }
        }
        return list;
    }
    @Override
    public Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) {
        LambdaUpdateWrapper<Specifications> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Specifications::getId, updateSpeStateSpecificationsDto.getId());
        updateWrapper.set(Specifications::getSpe_state, updateSpeStateSpecificationsDto.getSpe_state());
        return specificationsMapper.update(new Specifications(), updateWrapper);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuanchu.limslaboratory.mapper.StandardMapper;
import com.yuanchu.limslaboratory.pojo.Standard;
import com.yuanchu.limslaboratory.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
/**
 * <p>
 *  æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2023-07-11
 */
@Service
public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> implements StandardService {
    @Resource
    private StandardMapper standardMapper;
    @Autowired
    private UserService userService;
    @Lazy
    @Autowired
    private SpecificationsService specificationsService;
    @Autowired
    private MaterialService materialService;
    @Autowired
    private ProductService productService;
    @Override
    public Integer deleteStandardsInformation(String standardsId) {
        LambdaUpdateWrapper<Standard> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(Standard::getId, standardsId);
        updateWrapper.set(Standard::getState, 0);
        int isDeleteSuccess = standardMapper.update(new Standard(), updateWrapper);
        if (isDeleteSuccess == 1){
            List<Integer> deleteSpecificationsId = specificationsService.SerialNumberIdDeleteSpecifications(null);
            if (!ObjectUtils.isEmpty(deleteSpecificationsId)){
                List<String> deleteMaterialId = materialService.specificationsIdDeleteMaterial(deleteSpecificationsId);
                if (!ObjectUtils.isEmpty(deleteMaterialId)){
                    productService.MaterialIdDeleteProduct(deleteMaterialId);
                }
            }
            return 1;
        }
        return 0;
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardsServiceImpl.java
ÎļþÒÑɾ³ý
standard-server/src/main/resources/mapper/MaterialMapper.xml
@@ -7,7 +7,7 @@
        from material
        where state = 1
        order by create_time desc
        limit #{num1},#{num2}
            limit #{num1},#{num2}
    </select>
    <select id="selectMaterialById" resultType="java.util.Map">
        select m.id,
standard-server/src/main/resources/mapper/ProductMapper.xml
@@ -1,17 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.ProductMapper">
    <select id="selectProductByMaterialId" resultType="Product">
        select id, name, method, father, unit, required, internal
        from product
        where material_id = #{material_id}
        and state = 1
    </select>
    <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
ÎļþÒÑɾ³ý
standard-server/src/main/resources/mapper/SpecificationsMapper.xml
@@ -2,23 +2,4 @@
<!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">
    <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.`serial_id` = #{serialNumberId}
        <if test="specificationsName != null">
            AND s.`name` = #{specificationsName}
        </if>
    </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
        where m.specifications_id = s.id
        and s.serial_id = sn.id
        and m.id = #{materialId}
        order by s.create_time desc
        limit 1
    </select>
</mapper>
standard-server/src/main/resources/mapper/StandardMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.limslaboratory.mapper.StandardMapper">
</mapper>
standard-server/src/main/resources/mapper/StandardsMapper.xml
ÎļþÒÑɾ³ý