XiaoRuby
2023-08-19 3f0e25410f5aa3f01fda3d2d6410d89dc74159f3
Merge remote-tracking branch 'origin/master'
已修改29个文件
已添加7个文件
892 ■■■■ 文件已修改
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/LinkBasicInformationMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/RawMaterialMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/LinkBasicInformationService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/RawMaterialService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/LinkBasicInformationServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/RawMaterialServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/LinkBasicInformationMapper.xml 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/RawMaterialMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductModelController.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/MaterialMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductMapper.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductModelMapper.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SpecificationsMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Product.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/ProductModel.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/ProductModelDto.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductModelService.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductModelServiceImpl.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/MaterialMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/ProductMapper.xml 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/ProductModelMapper.xml 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/SpecificationsMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java
@@ -82,31 +82,6 @@
    }
    @ApiOperation(value = "选择原材料报检")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "原材料报检单id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "startTime", value = "检验开始日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "endTime", value = "检验结束日期", dataTypeClass = String.class, required = true)
    })
    @GetMapping("/selectRawmaById")
    public Result selectRawmaById(Integer id, String startTime, String endTime) throws ParseException {
        return Result.success(rawMaterialService.selectRawmaById(id, startTime, endTime));
    }
    @ApiOperation(value = "选择委托报检和样品")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "bid", value = "委托报检单id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "did", value = "委托报检样品id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/selectLinkByid")
    public Result selectLinkByid(Integer bid, Integer did) {
        return Result.success(linkBasicInformationService.selectLinkByid(bid, did));
    }
    @ApiOperation(value = "新增检验单")
    @PostMapping("/addInspect")
    public Result addInspect(@RequestHeader("token") String token, @RequestBody InspectionVo inspectionVo) throws Exception {
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/LinkBasicInformationMapper.java
@@ -27,11 +27,5 @@
     */
    List<Map<String, Object>> selectLinkAll();
    /**
     * é€‰æ‹©å§”托申请和样品
     * @param bid
     * @param did
     * @return
     */
    InspectionVo selectLinkByid(Integer bid, Integer did);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/RawMaterialMapper.java
@@ -26,5 +26,5 @@
    List<RawMaterial> selectRawmaAll();
    InspectionVo selectRawmaById(Integer id);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/LinkBasicInformationService.java
@@ -31,11 +31,5 @@
     */
    List<Map<String, Object>> selectLinkAll();
    /**
     * æ ¹æ®å§”托检验id和样品id查询委托检验和样品
     * @param bid
     * @param did
     * @return
     */
    InspectionVo selectLinkByid(Integer bid, Integer did);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/RawMaterialService.java
@@ -31,11 +31,5 @@
     */
    List<RawMaterial> selectRawmaAll();
    /**
     * é€‰æ‹©åŽŸææ–™æŠ¥æ£€
     *
     * @param id
     * @return
     */
    InspectionVo selectRawmaById(Integer id, String startTime, String endTime) throws ParseException;
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/LinkBasicInformationServiceImpl.java
@@ -56,11 +56,5 @@
        return linkBasicInformationMapper.selectLinkAll();
    }
    //根据委托检验id和样品id查询委托检验和样品
    @Override
    public InspectionVo selectLinkByid(Integer bid, Integer did) {
        InspectionVo inspectionVo = linkBasicInformationMapper.selectLinkByid(bid, did);
        inspectionVo.setType(1);
        return inspectionVo;
    }
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/RawMaterialServiceImpl.java
@@ -60,19 +60,5 @@
        return rawMaterialMapper.selectRawmaAll();
    }
    /**
     * é€‰æ‹©åŽŸææ–™æŠ¥æ£€
     *
     * @param id
     * @return
     */
    @Override
    public InspectionVo selectRawmaById(Integer id, String startTime, String endTime) throws ParseException {
        InspectionVo inspectionVo = rawMaterialMapper.selectRawmaById(id);
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        inspectionVo.setStartTime(formatter.parse(startTime));
        inspectionVo.setEndTime(formatter.parse(endTime));
        inspectionVo.setType(0);
        return inspectionVo;
    }
}
inspection-server/src/main/resources/mapper/LinkBasicInformationMapper.xml
@@ -1,11 +1,12 @@
<?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.LinkBasicInformationMapper">
    <select id="getLinkBasicPage" resultType="map">
        SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, d.`specifications_models`,
            DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, DATE_FORMAT(l.`completion_deadline`,'%Y-%m-%d') completionDeadline, l.`contacts`,
            DATE_FORMAT(d.`date_survey`,'%Y-%m-%d') dateSurvey, d.`inspection_status`
        SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`,
        d.`specifications_models`,
        DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, DATE_FORMAT(l.`completion_deadline`,'%Y-%m-%d')
        completionDeadline, l.`contacts`,
        DATE_FORMAT(d.`date_survey`,'%Y-%m-%d') dateSurvey, d.`inspection_status`
        FROM link_basic_information l, link_detection d
        WHERE l.`id` = d.`link_basic_id`
        AND l.`state` = 1
@@ -24,31 +25,19 @@
    </select>
    <select id="selectLinkAll" resultType="java.util.Map">
        SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, d.`specifications_models`,
        DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, l.`completion_deadline`, l.`contacts`, d.`date_survey`, d.`inspection_status`
        FROM lims_laboratory.link_basic_information l, lims_laboratory.link_detection d
        WHERE l.`id` = d.`link_basic_id`
        AND l.`state` = 1
    </select>
    <select id="selectLinkByid" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionVo">
        SELECT l.`inspection_time` formTime,
        l.`entrusted` supplier,
        d.`sample_number` mcode,
        d.`sample_name` name,
        d.`specifications_models` specifications,
        d.`unit`,
        d.`samples_number` num,
        d.date_survey startTime,
        l.completion_deadline endTime
        FROM lims_laboratory.link_basic_information l, lims_laboratory.link_detection d
        SELECT DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d')  formTime,
               l.`entrusted` supplier,
               d.`sample_number` mcode,
               d.`sample_name` name,
               d.`specifications_models` specifications,
               d.`unit`,
               d.`samples_number` num,
               DATE_FORMAT(date_survey,'%Y-%m-%d')  startTime,
               DATE_FORMAT(completion_deadline,'%Y-%m-%d') endTime
        FROM lims_laboratory.link_basic_information l,
             lims_laboratory.link_detection d
        WHERE l.`id` = d.`link_basic_id`
          AND l.`state` = 1
        <if test="bid!=null">
            and l.id=#{bid}
        </if>
        <if test="did!=null">
            and d.id=#{did}
        </if>
    </select>
</mapper>
inspection-server/src/main/resources/mapper/RawMaterialMapper.xml
@@ -23,15 +23,5 @@
        select * from lims_laboratory.raw_material where state=1
    </select>
    <select id="selectRawmaById" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionVo">
        select create_time formTime,
               supplier_name supplier,
               material_coding mcode,
               material_name name,
               specifications_models specifications,
               unit ,
               quantity num
        from lims_laboratory.raw_material
        where id=#{id}
    </select>
</mapper>
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java
@@ -30,7 +30,13 @@
    @Autowired
    private MaterialService materialService;
    @ApiOperation("添加物料")
    @ApiOperation(value = "添加指标-->选择样品名称")
    @GetMapping("/selectmater")
    public Result selectmater() {
        return Result.success(materialService.selectmater());
    }
    @ApiOperation("添加指标")
    @PostMapping("/add")
    public Result<?> addMaterialInformation(@Validated @RequestBody AddMaterialDto addMaterialDto) {
        Integer isMaterialSuccess = materialService.addMaterialInformation(addMaterialDto);
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java
@@ -15,7 +15,7 @@
/**
 * <p>
 *  å‰ç«¯æŽ§åˆ¶å™¨
 * å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
@@ -29,29 +29,15 @@
    @Autowired
    private ProductService productService;
    @ApiOperation("1、分页查询项目")
    @ApiOperation("查询该型号下的项目")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageNo", value = "起始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "specificationsId", value = "规格型号ID", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(value = "原材料编码/原材料名称", name = "productCodeOrName", dataTypeClass = String.class)
            @ApiImplicitParam(name = "specificationsId", value = "型号ID", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/page")
    public Result<?> pageProductInformation(Integer pageNo, Integer pageSize, Integer specificationsId, String productCodeOrName) {
        IPage<Map<String, Object>> maps = productService.pageProductInformation(productCodeOrName, specificationsId, new Page<Objects>(pageNo, pageSize));
        Map<String, Object> map = new HashMap<>();
        map.put("row", maps.getRecords());
        map.put("total", maps.getTotal());
        return Result.success(map);
    public Result<?> pageProductInformation(Integer specificationsId) {
        return Result.success(productService.pageProductInformation(specificationsId));
    }
    @ApiOperation("2、根据父类查子类")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "父类名称", name = "fatherName", dataTypeClass = String.class)
    })
    @GetMapping("/father")
    public Result<?> pageFatherNameProductInformation(String fatherName) {
        List<Map<String, Object>> maps = productService.pageFatherNameProductInformation(fatherName);
        return Result.success(maps);
    }
    //@ApiOperation("填写标准值与内控值,鼠标移开保存")
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductModelController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
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.dto.AddMaterialDto;
import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.yuanchu.limslaboratory.service.ProductModelService;
import java.util.HashMap;
import java.util.Map;
/**
 * åŸºç¡€é¡¹ç›®æ¨¡ç‰ˆè¡¨(ProductModel)表控制层
 *
 * @author zss
 * @since 2023-08-19 11:00:39
 */
@Api(tags = "基础数据-->标准维护")
@RestController
@RequestMapping("/productModel")
public class ProductModelController {
    @Autowired
    private ProductModelService productModelService;
    @ApiOperation(value = "选择样品名称")
    @GetMapping("/selectmater")
    public Result selectmater() {
        return Result.success(productModelService.selectmater());
    }
    @ApiOperation(value = "添加标准-->选择项目分组")
    @GetMapping("/selectfather")
    public Result selectfather() {
        return Result.success(productModelService.selectfather());
    }
    @ApiOperation("添加标准")
    @PostMapping("/addproductModel")
    public Result<?> addproductModel(@Validated @RequestBody ProductModelDto productModelDto) {
        productModelService.addproductModel(productModelDto);
        return Result.success("添加标准项目【" + productModelDto.getName() + "】成功!");
    }
    @ApiOperation(value = "查询标准模版列表")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "name", value = "项目名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "father", value = "项目分组", dataTypeClass = String.class),
            @ApiImplicitParam(name = "material", value = "样品名称", dataTypeClass = String.class, required = true)
    })
    @GetMapping("/selectproductModel")
    public Result selectproductModel(String name, String father, String material) {
        return Result.success(productModelService.selectproductModel(name, father, material));
    }
    @ApiOperation(value = "根据id查询")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "标准模版id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/selectproductModelById")
    public Result selectproductModelById(Integer id) {
        return Result.success(productModelService.selectproductModelById(id));
    }
    @ApiOperation("编辑")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "标准模版id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/writeproductModel")
    public Result<?> writeproductModel(Integer id, @Validated @RequestBody ProductModelDto productModelDto) {
        productModelService.writeproductModel(id,productModelDto);
        return Result.success("修改标准项目【" + productModelDto.getName() + "】成功!");
    }
    @ApiOperation("删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "标准模版id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/delproductModel")
    public Result<?> delproductModel(Integer id) {
        productModelService.delproductModel(id);
        return Result.success("删除标准项目成功!");
    }
    @ApiOperation("批量删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "ids", value = "标准模版id", dataTypeClass = String.class, required = true)
    })
    @PostMapping("/delAllproductModel")
    public Result<?> delAllproductModel(String ids) {
        productModelService.delAllproductModel(ids);
        return Result.success("批量删除标准项目成功!");
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
@@ -39,7 +39,7 @@
        return Result.fail("添加物料【"+ addSpecifications.getSpecificationsName() +"】失败!");
    }
    @ApiOperation("删除产品规格")
    @ApiOperation("删除产品型号")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "specificationsId", value = "规格Id", dataTypeClass = Integer.class, required = true)
    })
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardController.java
@@ -35,7 +35,7 @@
        return Result.fail("添加物料【"+ addStandardDto.getStandardName() +"】失败!");
    }
    @ApiOperation("根据ID删除数据")
    @ApiOperation("根据ID删规格")
    @DeleteMapping("/delete")
    public Result<?> deleteStandardsInformation(Integer standardsId) {
        Integer isDeleteMaterialSuccess = standardService.deleteStandardInformation(standardsId);
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/MaterialMapper.java
@@ -16,6 +16,7 @@
 */
public interface MaterialMapper extends BaseMapper<Material> {
    //查询物料信息
    List<Map> selectMaterialLimit(int num1,int num2, int type);
@@ -24,4 +25,10 @@
    // å››çº§æ ‘
    List<Map<String, Object>> FourTree(String specificationsName);
    //选择样品名称
    List<String> selectmater();
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductMapper.java
@@ -23,12 +23,9 @@
    //根据物料id查询检验项目
    List<Map> selectProductByMaterialId(int materialId);
    IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page);
    //展示该型号下的检验项目要求
    List<Map<String, Object>> pageProductInformation(Integer specificationsId);
    Map<String, Object> selectOneChildren(Object father);
    Map<String, Object> getProductInformation(Integer productId);
    //通过项目名查询项目的试验方法
    List<Map> selectInstrumentByProname(String name);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductModelMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
package com.yuanchu.limslaboratory.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanchu.limslaboratory.pojo.ProductModel;
import java.util.List;
import java.util.Map;
/**
 * åŸºç¡€é¡¹ç›®æ¨¡ç‰ˆè¡¨(ProductModel)表数据库访问层
 *
 * @author zss
 * @since 2023-08-19 11:00:39
 */
public interface ProductModelMapper extends BaseMapper<ProductModel> {
    //查询标准模版列表
    List<Map<String, Object>> selectproductModel(String name, String father, String material);
    //批量删除
    void delAllproductModel(String ids);
    //添加标准-->选择项目分组
    List<String> selectfather();
    //查询项目模版根据样品名
    List<Map<String, Object>> seleMode(String name);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/SpecificationsMapper.java
@@ -21,4 +21,8 @@
    Map<String, Object> selectSNameSNName(int materialId);
    IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page);
    //根据型号id查询物料名称
    String selMateName(Integer standardId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Material.java
@@ -39,7 +39,7 @@
    @ApiModelProperty(value = "物料名称", example = "石头", required = true)
    private String name;
    @ApiModelProperty(value = "0:原材料;1:成品;2:半成品", example = "1", required = true)
    @ApiModelProperty(value = "0:原材料;1:成品;2:半成品", example = "1")
    private Integer type;
    @TableLogic(value = "1", delval = "0")
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Product.java
@@ -31,22 +31,22 @@
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "项目名称", example = "单位长度质量", required = true)
    @ApiModelProperty(value = "项目名称", example = "铝包钢芯铝绞线", required = true)
    private String name;
    @ApiModelProperty(value = "项目父类", example = "铝包钢芯铝绞线")
    @ApiModelProperty(value = "项目父类", example = "单位长度质量")
    private String father;
    @ApiModelProperty(value = "单位", example = "km", required = true)
    @ApiModelProperty(value = "单位", example = "km")
    private String unit;
    @ApiModelProperty(value = "标准值", example = "<=0.3458", required = true)
    @ApiModelProperty(value = "标准值", example = "<=0.3458")
    private String required;
    @ApiModelProperty(value = "内控值", example = "<=0.3458", required = true)
    @ApiModelProperty(value = "内控值", example = "<=0.3458")
    private String internal;
    @TableLogic(value = "1", delval = "0")
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    private Integer state;
@@ -63,7 +63,7 @@
    @ApiModelProperty(value = "乐观锁", hidden = true)
    private Integer version;
    @ApiModelProperty(value = "关联 ç‰©æ–™id", example = "1", hidden = true)
    @ApiModelProperty(value = "关联 åž‹å·id", example = "1", hidden = true)
    private Integer specifications_id;
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/ProductModel.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.yuanchu.limslaboratory.pojo;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Date;
import java.io.Serializable;
/**
 * åŸºç¡€é¡¹ç›®æ¨¡ç‰ˆè¡¨(ProductModel)表实体类
 *
 * @author zss
 * @since 2023-08-19 11:00:40
 */
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("product_model")
public class ProductModel implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     **/
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * é¡¹ç›®åç§°
     **/
    private String name;
    /**
     * é¡¹ç›®çˆ¶ç±»
     **/
    private String father;
    /**
     * å•位
     **/
    private String unit;
    @ApiModelProperty(value = "逻辑删除 æ­£å¸¸>=1,删除<=0", hidden = true)
    private Integer state;
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * æ ·å“åç§°
     **/
    private String material;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/dto/ProductModelDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.yuanchu.limslaboratory.pojo.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
//添加标准参数
public class ProductModelDto {
    /**
     * é¡¹ç›®åç§°
     **/
    @NotBlank(message = "项目名称不能为空")
    private String name;
    /**
     * é¡¹ç›®çˆ¶ç±»
     **/
    private String father;
    /**
     * å•位
     **/
    private String unit;
    /**
     * æ ·å“åç§°
     **/
    @NotBlank(message = "样品名称不能为空")
    private String material;
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java
@@ -39,4 +39,12 @@
     * å››çº§åˆ†å±‚显示
     */
    List<Map<String, Object>> getFourLevelInformation(String specificationName);
    /**
     * æ·»åŠ æŒ‡æ ‡-->选择样品名称
     * @return
     */
    List<String> selectmater();
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductModelService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
package com.yuanchu.limslaboratory.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.limslaboratory.pojo.ProductModel;
import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto;
import java.util.List;
import java.util.Map;
/**
 * åŸºç¡€é¡¹ç›®æ¨¡ç‰ˆè¡¨(ProductModel)表服务接口
 *
 * @author zss
 * @since 2023-08-19 11:00:39
 */
public interface ProductModelService extends IService<ProductModel> {
    /**
     * é€‰æ‹©æ ·å“åç§°
     * @return
     */
    List<String>  selectmater();
    /**
     * æ·»åŠ æ ‡å‡†-->选择项目分组
     * @return
     */
    List<String> selectfather();
    /**
     * æ·»åŠ æ ‡å‡†
     * @param productModelDto
     */
    void addproductModel(ProductModelDto productModelDto);
    /**
     * æŸ¥è¯¢æ ‡å‡†æ¨¡ç‰ˆåˆ—表
     * @param name
     * @param father
     * @param material
     * @return
     */
    List<Map<String,Object>> selectproductModel(String name, String father, String material);
    /**
     * æ ¹æ®id查询
     * @param id
     * @return
     */
    ProductModelDto selectproductModelById(Integer id);
    /**
     * ç¼–辑
     * @param id
     * @param productModelDto
     */
    void writeproductModel(Integer id, ProductModelDto productModelDto);
    /**
     * åˆ é™¤
     * @param id
     */
    void delproductModel(Integer id);
    /**
     * æ‰¹é‡åˆ é™¤
     * @param ids
     */
    void delAllproductModel(String ids);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java
@@ -21,14 +21,11 @@
public interface ProductService extends IService<Product> {
    void deleteProductInformation(List<Integer> SpecificationsId);
    IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page);
    List<Map<String, Object>> pageFatherNameProductInformation(String fatherName);
    /**
     * é€šè¿‡é¡¹ç›®åæŸ¥è¯¢é¡¹ç›®çš„试验方法
     * @param name
     * å±•示该型号下的检验项目要求
     * @param specificationsId
     * @return
     */
    List<Map> selectInstrumentByProname(String name);
    List<Map<String,Object>> pageProductInformation(Integer specificationsId);
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/StandardService.java
@@ -29,6 +29,7 @@
    @Transactional(rollbackFor = Exception.class)
    Integer deleteStandardInformation(Integer standardsId);
    //二级新增
    Integer addStandardInformation(AddStandardDto addStandardDto);
    List<Map<String, Object>> getSpecificationIdAndName(String materialId);
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java
@@ -4,8 +4,11 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yuanchu.limslaboratory.mapper.ProductModelMapper;
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.mapper.MaterialMapper;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.pojo.Standard;
import com.yuanchu.limslaboratory.pojo.dto.AddMaterialDto;
@@ -15,16 +18,20 @@
import com.yuanchu.limslaboratory.service.SpecificationsService;
import com.yuanchu.limslaboratory.service.StandardService;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * <p>
 *  æœåŠ¡å®žçŽ°ç±»
 * æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
@@ -45,12 +52,14 @@
    @Autowired
    private ProductService productService;
    @Resource
    ProductModelMapper productModelMapper;
    //查询物料信息
    @Override
    public List<Map> selectMaterialLimit(int pageSize, int countSize, int type) {
        return materialMapper.selectMaterialLimit((pageSize - 1) * countSize,pageSize * countSize, type);
        return materialMapper.selectMaterialLimit((pageSize - 1) * countSize, pageSize * countSize, type);
    }
    @Override
@@ -59,11 +68,11 @@
        updateWrapper.eq(Material::getId, materialId);
        updateWrapper.set(Material::getState, 0);
        int isDeleteSuccess = materialMapper.update(new Material(), updateWrapper);
        if (isDeleteSuccess == 1){
        if (isDeleteSuccess == 1) {
            List<Integer> isDeleteStandard = standardService.deleteStandardsInformation(materialId);
            if (!ObjectUtils.isEmpty(isDeleteStandard)){
            if (!ObjectUtils.isEmpty(isDeleteStandard)) {
                List<Integer> idDeleteSpecifications = specificationsService.StandardIdDeleteSpecifications(isDeleteStandard);
                if (!ObjectUtils.isEmpty(idDeleteSpecifications)){
                if (!ObjectUtils.isEmpty(idDeleteSpecifications)) {
                    productService.deleteProductInformation(idDeleteSpecifications);
                }
            }
@@ -72,25 +81,37 @@
        return 0;
    }
    //三级新增
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Integer addMaterialInformation(AddMaterialDto addMaterialDto) {
        Material material = new Material()
                .setCode("BZ" + IdWorker.getIdStr())
                .setName(addMaterialDto.getMaterialName())
                .setType(addMaterialDto.getType());
        int isInsertSuccess = materialMapper.insert(material);
        if (isInsertSuccess > 0){
        Material material = materialMapper.selectOne(Wrappers.<Material>query().eq("name", addMaterialDto.getMaterialName()));
        material.setType(addMaterialDto.getType());
        int isInsertSuccess = materialMapper.updateById(material);
        if (isInsertSuccess > 0) {
            Standard standard = new Standard()
                    .setMaterialId(material.getId())
                    .setName(addMaterialDto.getStandardName());
            boolean save = standardService.save(standard);
            if (save){
            if (save) {
                Specifications specifications = new Specifications()
                        .setName(addMaterialDto.getSpecificationsName())
                        .setStandardId(standard.getId());
                boolean save1 = specificationsService.save(specifications);
                if (save1)
                if (save1) {
                    //添加型号之后添加项目
                    List<Map<String, Object>> productModel = productModelMapper.seleMode(addMaterialDto.getMaterialName());
                    List<Product> productList = productModel.stream().map(stringObjectMap -> {
                        Product product = new Product();
                        product.setName(stringObjectMap.get("name").toString());
                        product.setFather(stringObjectMap.get("father").toString());
                        product.setUnit(stringObjectMap.get("unit").toString());
                        product.setSpecifications_id(specifications.getId());
                        return product;
                    }).collect(Collectors.toList());
                    productService.saveBatch(productList);
                    return 1;
                }
            }
        }
        return 0;
@@ -100,4 +121,12 @@
    public List<Map<String, Object>> getFourLevelInformation(String specificationName) {
        return materialMapper.FourTree(specificationName);
    }
    //添加指标-->选择样品名称
    @Override
    public List<String> selectmater() {
        return materialMapper.selectmater();
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductModelServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.mapper.MaterialMapper;
import com.yuanchu.limslaboratory.mapper.ProductModelMapper;
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.pojo.ProductModel;
import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto;
import com.yuanchu.limslaboratory.service.ProductModelService;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * åŸºç¡€é¡¹ç›®æ¨¡ç‰ˆè¡¨(ProductModel)表服务实现类
 *
 * @author zss
 * @since 2023-08-19 11:00:40
 */
@Service
public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, ProductModel> implements ProductModelService {
    @Resource
    ProductModelMapper productModelMapper;
    @Resource
    MaterialMapper materialMapper;
    //选择样品
    @Override
    public List<String> selectmater() {
        return materialMapper.selectmater();
    }
    //添加标准-->选择项目分组
    @Override
    public List<String> selectfather() {
        return productModelMapper.selectfather();
    }
    //添加标准
    @Override
    public void addproductModel(ProductModelDto productModelDto) {
        ProductModel productModel = new ProductModel();
        BeanUtils.copyProperties(productModelDto,productModel);
        productModelMapper.insert(productModel);
        //添加物料产品库
        Material material = new Material();
        material.setName(productModelDto.getName()).setCode(MyUtil.getTimeSixNumberCode("CP","CP"));
        materialMapper.insert(material);
    }
    //查询标准模版列表
    @Override
    public List<Map<String, Object>> selectproductModel(String name, String father, String material) {
        return productModelMapper.selectproductModel(name,father,material);
    }
    //根据id查询详情
    @Override
    public ProductModelDto selectproductModelById(Integer id) {
        ProductModel productModel = productModelMapper.selectById(id);
        ProductModelDto productModelDto = new ProductModelDto();
        BeanUtils.copyProperties(productModel,productModelDto);
        return productModelDto;
    }
    //编辑
    @Override
    public void writeproductModel(Integer id, ProductModelDto productModelDto) {
        ProductModel productModel = new ProductModel();
        BeanUtils.copyProperties(productModelDto,productModel);
        productModel.setId(id);
        productModelMapper.updateById(productModel);
    }
    //删除
    @Override
    public void delproductModel(Integer id) {
        ProductModel productModel = new ProductModel();
        productModel.setId(id).setState(0);
        productModelMapper.updateById(productModel);
    }
    //批量删除
    @Override
    public void delAllproductModel(String ids) {
        productModelMapper.delAllproductModel(ids);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java
@@ -4,14 +4,18 @@
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.mapper.ProductModelMapper;
import com.yuanchu.limslaboratory.mapper.SpecificationsMapper;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.mapper.ProductMapper;
import com.yuanchu.limslaboratory.pojo.ProductModel;
import com.yuanchu.limslaboratory.service.ProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import com.yuanchu.limslaboratory.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
@@ -34,6 +38,10 @@
    @Resource
    private ProductMapper productMapper;
    @Resource
    ProductModelMapper productModelMapper;
    @Override
    public void deleteProductInformation(List<Integer> SpecificationsId) {
        for (Integer materialId : SpecificationsId){
@@ -44,36 +52,12 @@
        }
    }
    //展示该型号下的检验项目要求
    @Override
    public IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page) {
        IPage<Map<String, Object>> iPage = productMapper.pageProductInformation(productCodeOrName, specificationsId, page);
        List<Map<String, Object>> maps = iPage.getRecords();
        maps.forEach(map -> {
            int num = Integer.parseInt(map.get("num").toString());
            boolean children = false;
            if (num > 1){
                children = true;
            } else {
                Map<String, Object> product = productMapper.selectOneChildren(map.get("father"));
                map.putAll(product);
            }
            map.put("children", children);
            map.remove("num");
        });
        return iPage;
    @Transactional(rollbackFor = Exception.class)
    public List<Map<String, Object>> pageProductInformation(Integer specificationsId) {
        return productMapper.pageProductInformation(specificationsId);
    }
    @Override
    public List<Map<String, Object>> pageFatherNameProductInformation(String fatherName) {
        LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Product::getFather, fatherName);
        wrapper.select(Product::getId, Product::getName, Product::getUnit, Product::getRequired, Product::getInternal);
        return productMapper.selectMaps(wrapper);
    }
    //通过项目名查询项目的试验方法
    @Override
    public List<Map> selectInstrumentByProname(String name) {
        return productMapper.selectInstrumentByProname(name);
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/SpecificationsServiceImpl.java
@@ -2,12 +2,15 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuanchu.limslaboratory.mapper.ProductModelMapper;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.mapper.SpecificationsMapper;
import com.yuanchu.limslaboratory.pojo.dto.AddSpecifications;
import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto;
import com.yuanchu.limslaboratory.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@@ -16,6 +19,8 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * <p>
@@ -33,6 +38,9 @@
    @Autowired
    private ProductService productService;
    @Resource
    ProductModelMapper productModelMapper;
    @Override
    public Integer deleteSpecifications(Integer specificationsId) {
@@ -73,6 +81,18 @@
        Specifications specifications = new Specifications()
                .setName(addStandardDto.getSpecificationsName())
                .setStandardId(addStandardDto.getStandardId());
        return specificationsMapper.insert(specifications);
         specificationsMapper.insert(specifications);
        //添加型号之后添加项目
        List<Map<String, Object>> productModel=productModelMapper.seleMode(specificationsMapper.selMateName(addStandardDto.getStandardId()));
        List<Product> productList = productModel.stream().map(stringObjectMap -> {
            Product product = new Product();
            product.setName(stringObjectMap.get("name").toString());
            product.setFather(stringObjectMap.get("father").toString());
            product.setUnit(stringObjectMap.get("unit").toString());
            product.setSpecifications_id(specifications.getId());
            return product;
        }).collect(Collectors.toList());
        productService.saveBatch(productList);
        return 1;
    }
}
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/StandardServiceImpl.java
@@ -3,21 +3,27 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.yuanchu.limslaboratory.mapper.MaterialMapper;
import com.yuanchu.limslaboratory.mapper.ProductModelMapper;
import com.yuanchu.limslaboratory.mapper.StandardMapper;
import com.yuanchu.limslaboratory.pojo.Material;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.pojo.Standard;
import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto;
import com.yuanchu.limslaboratory.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * <p>
@@ -39,6 +45,12 @@
    @Autowired
    private ProductService productService;
    @Resource
    ProductModelMapper productModelMapper;
    @Resource
    MaterialMapper materialMapper;
    @Override
@@ -76,7 +88,9 @@
        return 0;
    }
    //二级新增
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Integer addStandardInformation(AddStandardDto addStandardDto) {
        Standard standard = new Standard()
                .setMaterialId(addStandardDto.getMaterialId())
@@ -87,8 +101,20 @@
                    .setName(addStandardDto.getSpecificationsName())
                    .setStandardId(standard.getId());
            boolean save1 = specificationsService.save(specifications);
            if (save1)
            if (save1){
                //添加型号之后添加项目
                List<Map<String, Object>> productModel=productModelMapper.seleMode(materialMapper.selectById(addStandardDto.getMaterialId()).getName());
                List<Product> productList = productModel.stream().map(stringObjectMap -> {
                    Product product = new Product();
                    product.setName(stringObjectMap.get("name").toString());
                    product.setFather(stringObjectMap.get("father").toString());
                    product.setUnit(stringObjectMap.get("unit").toString());
                    product.setSpecifications_id(specifications.getId());
                    return product;
                }).collect(Collectors.toList());
                productService.saveBatch(productList);
                return 1;
            }
        }
        return 0;
    }
standard-server/src/main/resources/mapper/MaterialMapper.xml
@@ -1,14 +1,13 @@
<?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.MaterialMapper">
    <select id="selectMaterialLimit" resultType="Map">
        select id, code, name
        from lims_laboratory.material
        where state = 1
          and type = #{type}
        order by create_time desc
            limit #{num1}, #{num2}
        limit #{num1}, #{num2}
    </select>
    <select id="selectMaterialById" resultType="Map">
        select m.id,
@@ -57,16 +56,22 @@
    <select id="FourTree" resultMap="OneLevelTreeMap">
        SELECT m.`id` materialId, m.`name` materialName, s.`id` standardId, s.`name` standardName,
        f.`id` specificationsId, f.`name` specificationsName, p.`id` productId, p.`name` productName
        FROM material m
        LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM standard s WHERE s.`state` = 1) s ON m.id =
        FROM lims_laboratory.material m
        LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM lims_laboratory.standard s WHERE s.`state` = 1) s ON m.id =
        s.`material_id`
        LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM specifications f WHERE f.`state` = 1
        LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM lims_laboratory.specifications f WHERE f.`state` = 1
        <if test="specificationsName != null and specificationsName != ''">
            AND f.`name` = #{specificationsName}
        </if>
        ) f ON s.`id` = f.`standard_id`
        LEFT JOIN (SELECT p.`id`, p.`name`, p.`specifications_id` FROM product p WHERE p.`state` = 1) p ON f.`id` =
        LEFT JOIN (SELECT p.`id`, p.`name`, p.`specifications_id` FROM lims_laboratory.product p WHERE p.`state` = 1) p ON f.`id` =
        p.`specifications_id`
        WHERE m.`state` = 1
    </select>
    <!--添加标准选择样品名称-->
    <select id="selectmater" resultType="java.lang.String">
        select  name
        from lims_laboratory.material
        where state = 1
    </select>
</mapper>
standard-server/src/main/resources/mapper/ProductMapper.xml
@@ -1,29 +1,25 @@
<?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="pageProductInformation" resultType="map">
        SELECT COUNT(1) num, p.`father`
        FROM product p
        WHERE p.`specifications_id` = #{specificationsId}
        <if test="productCodeOrName != null and productCodeOrName != ''">
            AND p.`father` = #{productCodeOrName}
        </if>
        GROUP BY p.`father`
    </select>
    <select id="selectOneChildren" resultType="map">
        SELECT p.`id`, p.`name`, p.`unit`, p.`required`, p.`internal`
        FROM product p
        WHERE p.`father` = #{father}
    </select>
    <select id="selectProductByMaterialId" resultType="Map">
        select p.name,unit,required,internal
        select p.name, unit, required, internal
        from lims_laboratory.product p,
             lims_laboratory.specifications sp,
             lims_laboratory.standard st
        where specifications_id=sp.id
          and standard=st.id
        and material_id=#{materialId}
        where specifications_id = sp.id
          and standard_id = st.id
          and material_id = #{materialId}
    </select>
    <!--展示该型号下的检验项目要求-->
    <select id="pageProductInformation" resultType="java.util.Map">
        select name,
               father,
               unit,
               required,
               internal
        from lims_laboratory.product
        where state=1
        and specifications_id=#{specificationsId}
    </select>
</mapper>
standard-server/src/main/resources/mapper/ProductModelMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
<?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.ProductModelMapper">
    <!--查询标准模版列表-->
    <select id="selectproductModel" resultType="java.util.Map">
        select id,
        father,
        name,
        unit
        from lims_laboratory.product_model
        where state=1
        and material=#{material}
        <if test="name!=null and name!=''">
            and name like concat('%',#{name},'%')
        </if>
        <if test="father!=null and father!=''">
            and father like concat('%',#{father},'%')
        </if>
        order by father
    </select>
    <update id="delAllproductModel">
        update lims_laboratory.product_model
        set state=0
        where id in (${ids})
    </update>
    <!--添加标准选择项目分组-->
    <select id="selectfather" resultType="java.lang.String">
        select distinct father
        from lims_laboratory.product_model
        where state = 1
    </select>
    <!--查询项目模版根据样品名-->
    <select id="seleMode" resultType="java.util.Map">
        select name,
               father,
               unit
        from lims_laboratory.product_model
        where state = 1
          and material =#{name}
    </select>
</mapper>
standard-server/src/main/resources/mapper/SpecificationsMapper.xml
@@ -1,5 +1,14 @@
<?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.SpecificationsMapper">
    <!--根据规格id查询物料名称-->
    <select id="selMateName" resultType="java.lang.String">
        select name
        from lims_laboratory.material
        where state = 1
          and id = (select material_id
                    from lims_laboratory.standard
                    where standard.state = 1
                      and standard.id=#{standardId});
    </select>
</mapper>
sys/src/main/resources/application-dev.yml
@@ -67,7 +67,7 @@
    # redis服务器地址(默认为localhost)
    host: 192.168.110.209
    # redis端口(默认为6379)
    port: 6379
    port: 6380
    # redis访问密码(默认为空)
    password: null
    # redis连接超时时间(单位毫秒)