XiaoRuby
2023-08-21 4b55cf8d21443e366f83acf20c4333abef8f54ae
Merge remote-tracking branch 'origin/master'
已修改22个文件
已删除7个文件
530 ■■■■■ 文件已修改
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionMaterialController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionProductController.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/PlanMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/InspectionProduct.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/PlanVo.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/InspectionMaterialService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/InspectionProductService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/PlanService.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionProductServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/PlanServiceImpl.java 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/InspectionMaterialMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/InspectionProductMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/PlanMapper.xml 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/ReportMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/InstrumentMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/InstrumentService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InstrumentServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/ProductModel.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductModelServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/resources/mapper/ProductMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/test/java/com/yuanchu/limslaboratory/SysApplicationTests.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/mapper/UserMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java
@@ -90,7 +90,7 @@
        return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo));
    }
    @ApiOperation(value = "根据检验单id查询原材料检验单详情")
    @ApiOperation(value = "根据检验单id查询检验单详情")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true)
    })
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionMaterialController.java
ÎļþÒÑɾ³ý
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionProductController.java
ÎļþÒÑɾ³ý
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java
@@ -1,19 +1,17 @@
package com.yuanchu.limslaboratory.controller;
import com.yuanchu.limslaboratory.pojo.vo.PlanVo;
import com.yuanchu.limslaboratory.service.PlanService;
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.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.*;
/**
 * <p>
@@ -32,16 +30,38 @@
    private PlanService planService;
    @ApiOperation("查询检验计划")
    @ApiOperation("查询所有检验计划")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "device", value = "设备名称Id", dataTypeClass = String.class),
            @ApiImplicitParam(name = "beginTime", value = "检验开始时间", dataTypeClass = Date.class),
            @ApiImplicitParam(name = "endTime", value = "检验结束时间", dataTypeClass = Date.class),
            @ApiImplicitParam(name = "user", value = "检验人", dataTypeClass = String.class)
            @ApiImplicitParam(name = "code", value = "申请单编号", dataTypeClass = String.class),
            @ApiImplicitParam(name = "beginTime", value = "检验开始时间", dataTypeClass = String.class),
            @ApiImplicitParam(name = "endTime", value = "检验结束时间", dataTypeClass = String.class),
            @ApiImplicitParam(name = "status", value = "检验结果", dataTypeClass = Integer.class)
    })
    @GetMapping("/selectAllPlan")
    public Result selectAllPlan(String device, @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, String user) {
        List<PlanVo> planVoList = planService.selectAllPlan(device, beginTime, endTime, user);
        return Result.success(planVoList);
    public Result selectAllPlan(String code, String beginTime, String endTime, Integer status) {
        return Result.success(planService.selectAllPlan(code, beginTime, endTime, status));
    }
    @ApiOperation("分配-->选择检验人")
    @GetMapping("/choosecheck")
    public Result choosecheck() {
        return Result.success(planService.choosecheck());
    }
    @ApiOperation("分配--选择设备")
    @GetMapping("/chooseinstum")
    public Result chooseinstum() {
        return Result.success(planService.chooseinstum());
    }
    @ApiOperation("分配")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验项目id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "userId", value = "检验人id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "instrumentId", value = "设备id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/distribution")
    public Result distribution(Integer id, Integer userId, Integer instrumentId) {
        return Result.success(planService.distribution(id, userId, instrumentId));
    }
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/mapper/PlanMapper.java
@@ -1,14 +1,10 @@
package com.yuanchu.limslaboratory.mapper;
import com.yuanchu.limslaboratory.pojo.vo.PlanVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface PlanMapper {
    /**
     * æŸ¥è¯¢æ£€éªŒè®¡åˆ’
     * @return
     */
    List<PlanVo> selectAllPlan(String device, Date beginTime, Date endTime, String user);
    //查询检验计划
    List<Map<String, Object>> selectAllPlan(String code, String beginTime, String endTime,Integer status);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/InspectionProduct.java
@@ -66,17 +66,13 @@
     **/
    private Integer state;
    /**
     * ${column.comment}
     **/
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;
    /**
     * ${column.comment}
     **/
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/PlanVo.java
ÎļþÒÑɾ³ý
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/InspectionMaterialService.java
ÎļþÒÑɾ³ý
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/InspectionProductService.java
@@ -12,12 +12,6 @@
 */
public interface InspectionProductService extends IService<InspectionProduct> {
    /**
     * æ›´æ–°æ£€éªŒé¡¹ç›®
     * @param userId
     * @param inspectionProduct
     * @return
     */
    boolean updateInsProduct(Integer userId, InspectionProduct inspectionProduct);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/PlanService.java
@@ -1,9 +1,7 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.pojo.vo.PlanVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -18,6 +16,23 @@
     * æŸ¥è¯¢æ£€éªŒè®¡åˆ’
     * @return
     */
    List<PlanVo> selectAllPlan(String device, Date beginTime, Date endTime, String user);
    List<Map<String,Object>> selectAllPlan(String code , String beginTime, String endTime,Integer status);
    /**
     * åˆ†é…-->选择检验人
     * @return
     */
    List<Map<String,Object>> choosecheck();
    /**
     * åˆ†é…-->选择设备
     * @return
     */
    List<Map<String,Object>> chooseinstum();
    /**
     * åˆ†é…
     * @return
     */
    String distribution(Integer id, Integer userId, Integer instrumentId);
}
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialServiceImpl.java
ÎļþÒÑɾ³ý
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionProductServiceImpl.java
@@ -22,7 +22,7 @@
    @Resource
    InspectionProductMapper inspectionProductMapper;
    //更新检验项目
   /* //更新检验项目
    @Override
    public boolean updateInsProduct(Integer userId, InspectionProduct inspectionProduct) {
        //赋值检验员id
@@ -38,7 +38,7 @@
                .eq(InspectionProduct::getName, inspectionProduct.getName());
        inspectionProductMapper.update(inspectionProduct, updateWrapper);
        return true;
    }
    }*/
    /*判断检测值是否满足标准值和内控值的要求,如果不满足则检验结论为不合格*/
    private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) {
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
@@ -16,6 +16,7 @@
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
@@ -82,6 +83,7 @@
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Integer addInspect(Integer id, InspectionVo inspectionVo) {
        /*新增检验申请表*/
        Inspection inspection = Inspection.builder()
@@ -142,6 +144,7 @@
    //根据检验单id查询原材料检验单详情
    @Override
    @Transactional(rollbackFor = Exception.class)
    public InspectDetailVo selectInspectsListById(Integer id) {
        /*将检验单基本信息查询出来并封装到RawInspectVo对象中*/
        Inspection inspection = inspectionMapper.selectById(id);
@@ -187,6 +190,7 @@
    //更新检验单检验结果
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateInspectsById(Integer id) {
        //更新检验单里面的检验状态和检验结论
        InspectDetailVo inspectDetailVo = selectInspectsListById(id);
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/PlanServiceImpl.java
@@ -1,13 +1,18 @@
package com.yuanchu.limslaboratory.service.impl;
import com.yuanchu.limslaboratory.mapper.PlanMapper;
import com.yuanchu.limslaboratory.pojo.vo.PlanVo;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yuanchu.limslaboratory.mapper.*;
import com.yuanchu.limslaboratory.pojo.InspectionProduct;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.pojo.User;
import com.yuanchu.limslaboratory.service.InstrumentService;
import com.yuanchu.limslaboratory.service.PlanService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -23,39 +28,41 @@
    @Resource
    private PlanMapper planMapper;
    /**
     * æŸ¥è¯¢æ£€éªŒè®¡åˆ’
     *
     * @return
     */
    @Resource
    InspectionProductMapper inspectionProductMapper;
    @Resource
    UserMapper userMapper;
    @Resource
    InstrumentMapper instrumentMapper;
    //查询检验计划
    @Override
    public List<PlanVo> selectAllPlan(String device, Date beginTime, Date endTime, String user) {
        //获取数据库数据
        List<PlanVo> planVos = planMapper.selectAllPlan(device, beginTime, endTime, user);
        //添加计划工期和检验进度
        planVos.forEach(planVo -> {
            //添加检验进度
            //判断是否是已完成
            if (planVo.getState() != null) {
                planVo.setProgress(100);
            }
            //判断是否是未分配
            if (planVo.getCheckproject() == null) {
                planVo.setProgress(0);
            }
            //判断是否是进行中
            if (planVo.getState() == null && planVo.getCheckproject() != null) {
                planVo.setProgress(50);
            }
            //添加计划工期
            if (planVo.getFinishtime() != null && planVo.getStarttime() != null) {
                long startTimeInMillis = planVo.getStarttime().getTime();
                long endTimeInMillis = planVo.getFinishtime().getTime();
                long durationInMillis = endTimeInMillis - startTimeInMillis;
                long duration = durationInMillis / (1000 * 60 * 60);
                planVo.setDuration(Integer.valueOf((int) duration));
            }
        });
        return planVos;
    public  List<Map<String,Object>> selectAllPlan(String code , String beginTime, String endTime,Integer status) {
        return planMapper.selectAllPlan(code,beginTime,endTime,status);
    }
    //分配-->选择检验人
    @Override
    public List<Map<String, Object>> choosecheck() {
        return userMapper.selectUser();
    }
    //分配-->选择设备
    @Override
    public List<Map<String, Object>> chooseinstum() {
        return null;
    }
    //分配人员与设备
    @Override
    public String distribution(Integer id, Integer userId, Integer instrumentId) {
        InspectionProduct inspectionProduct = new InspectionProduct();
        inspectionProduct.setId(id);
        inspectionProduct.setUserId(userId);
        inspectionProduct.setInstrumentId(instrumentId);
        inspectionProductMapper.updateById(inspectionProduct);
        return "分配完成!";
    }
}
inspection-server/src/main/resources/mapper/InspectionMaterialMapper.xml
ÎļþÒÑɾ³ý
inspection-server/src/main/resources/mapper/InspectionProductMapper.xml
ÎļþÒÑɾ³ý
inspection-server/src/main/resources/mapper/PlanMapper.xml
@@ -1,39 +1,56 @@
<?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.PlanMapper">
    <resultMap id="selectAllPlanMap" type="map" >
        <id property="code" column="code"/>
        <result property="inspectionStatus" column="inspectionStatus"/>
        <result property="startTime" column="startTime"/>
        <result property="endTime" column="endTime"/>
        <collection property="father" resultMap="selectAllPlanMapTowMap" javaType="List"/>
    </resultMap>
    <resultMap id="selectAllPlanMapTowMap" type="map">
        <id property="samplename" column="samplename"/>
        <collection property="chldren" resultMap="selectAllPlanMapTowsMap" javaType="List"/>
    </resultMap>
    <resultMap id="selectAllPlanMapTowsMap" type="map">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="unit" column="unit"/>
        <result property="required" column="required"/>
        <result property="internal" column="internal"/>
        <result property="testState" column="testState"/>
        <result property="checker" column="checker"/>
        <result property="instrumentname" column="instrumentname"/>
    </resultMap>
    <!--查询检验计划-->
    <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.vo.PlanVo">
        select i.equipment_name device,
    <select id="selectAllPlan" resultMap="selectAllPlanMap">
        select ip.id,
        i.code,
        inspection_status inspectionStatus,
        DATE_FORMAT(start_time,'%Y-%m-%d') startTime,
        DATE_FORMAT(end_time,'%Y-%m-%d') endTime,
        im.name samplename,
        im.code sampleid,
        im.specifications modelandspecification,
        im.unit unit,
        im.num amount,
        ip.name checkproject,
        ip.name,
        ip.unit,
        required,
        internal,
        test_state testState,
        u.name checker,
        ip.start_time starttime,
        ip.end_time finishtime,
        ip.test_state state
        from instrument i
        left join (select ip.*
        from inspection_product ip
        right join (select instrument_id, max(ip.end_time) t
        from inspection_product ip
        group by instrument_id) it
        on ip.instrument_id = it.instrument_id and ip.end_time = it.t) ip
        on i.id = ip.instrument_id
        left join inspection_material im on im.id = ip.inspection_material_id
        left join user u on u.id = ip.user_id
        equipment_name instrumentname
        from lims_laboratory.inspection_product ip
        left join lims_laboratory.inspection_material im on ip.inspection_material_id = im.id
        left join lims_laboratory.inspection i on im.inspection_id = i.id
        left join lims_laboratory.user u on ip.user_id = u.id
        left join  lims_laboratory.instrument isu on ip.instrument_id = isu.id
        <where>
            <if test="device != null and device != null">
                and i.equipment_name = #{device}
            <if test="code != null and code != null">
                and i.code like concat('%',#{code},'%')
            </if>
            <if test="user != null and user != null">
                and u.name = #{user}
            <if test="status != null ">
                and inspection_status = #{status}
            </if>
            <if test="beginTime != null and endTime != null">
                and ip.start_time between #{beginTime} and #{endTime}
                and i.start_time between #{beginTime} and #{endTime}
            </if>
        </where>
    </select>
inspection-server/src/main/resources/mapper/ReportMapper.xml
@@ -3,7 +3,8 @@
<mapper namespace="com.yuanchu.limslaboratory.mapper.ReportMapper">
    <!--查询检验报告-->
    <select id="selectAllReport" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportVo">select im.code materialCode,
    <select id="selectAllReport" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportVo">
        select im.code materialCode,
        r.code reportCode,
        i.code inspectionCode,
        r.approver approver,
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/InstrumentMapper.java
@@ -22,7 +22,6 @@
    IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions,Boolean whetherWhether, String numberOrNameOrSpecifications, Integer classifyId, Page<Objects> page);
    //查询所有设备信息
    List<Map> selectInstrument();
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/InstrumentService.java
@@ -35,10 +35,6 @@
    Integer updateEquipmentPointInformation(Instrument instrument);
    /**
     * æŸ¥è¯¢æ‰€æœ‰è®¾å¤‡ä¿¡æ¯
     * @return
     */
    List<Map> selectInstrument();
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InstrumentServiceImpl.java
@@ -81,9 +81,5 @@
        return 0;
    }
    //查询所有设备信息
    @Override
    public List<Map> selectInstrument() {
        return instrumentMapper.selectInstrument();
    }
}
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml
@@ -19,7 +19,5 @@
        </if>
        AND i.`user_id` = u.`id`
    </select>
    <select id="selectInstrument" resultType="Map">
        select id,equipment_name from lims_laboratory.instrument
    </select>
</mapper>
standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/ProductModel.java
@@ -3,10 +3,7 @@
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.*;
import lombok.experimental.Accessors;
import java.util.Date;
@@ -23,6 +20,7 @@
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Builder
@TableName("product_model")
public class ProductModel implements Serializable {
    private static final long serialVersionUID = 1L;
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductModelServiceImpl.java
@@ -1,5 +1,6 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.mapper.MaterialMapper;
import com.yuanchu.limslaboratory.mapper.ProductModelMapper;
@@ -45,19 +46,28 @@
    //添加标准
    @Override
    public void addproductModel(ProductModelDto productModelDto) {
        ProductModel productModel = new ProductModel();
        BeanUtils.copyProperties(productModelDto,productModel);
        productModelMapper.insert(productModel);
        if (ObjectUtils.isEmpty(productModelDto.getFather())) {
            ProductModel productModel = ProductModel.builder()
                    .name(productModelDto.getName())
                    .material(productModelDto.getMaterial())
                    .unit(productModelDto.getUnit())
                    .build();
            productModelMapper.insert(productModel);
        } else {
            ProductModel productModel = new ProductModel();
            BeanUtils.copyProperties(productModelDto, productModel);
            productModelMapper.insert(productModel);
        }
        //添加物料产品库
        Material material = new Material();
        material.setName(productModelDto.getName()).setCode(MyUtil.getTimeSixNumberCode("CP","CP"));
        material.setName(productModelDto.getMaterial()).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);
        return productModelMapper.selectproductModel(name, father, material);
    }
    //根据id查询详情
@@ -65,7 +75,7 @@
    public ProductModelDto selectproductModelById(Integer id) {
        ProductModel productModel = productModelMapper.selectById(id);
        ProductModelDto productModelDto = new ProductModelDto();
        BeanUtils.copyProperties(productModel,productModelDto);
        BeanUtils.copyProperties(productModel, productModelDto);
        return productModelDto;
    }
@@ -73,7 +83,7 @@
    @Override
    public void writeproductModel(Integer id, ProductModelDto productModelDto) {
        ProductModel productModel = new ProductModel();
        BeanUtils.copyProperties(productModelDto,productModel);
        BeanUtils.copyProperties(productModelDto, productModel);
        productModel.setId(id);
        productModelMapper.updateById(productModel);
    }
standard-server/src/main/resources/mapper/ProductMapper.xml
@@ -11,8 +11,21 @@
          and material_id = #{materialId}
    </select>
    <!--展示该型号下的检验项目要求-->
    <select id="pageProductInformation" resultType="java.util.Map">
    <resultMap id="pageProductInformationMap" type="map">
        <id property="father" column="father"/>
        <collection property="children" resultMap="pageProductInformationTowMap" javaType="List"/>
    </resultMap>
    <resultMap id="pageProductInformationTowMap" type="map">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="unit" column="unit"/>
        <result property="required" column="required"/>
        <result property="internal" column="internal"/>
    </resultMap>
    <select id="pageProductInformation" resultMap="pageProductInformationMap">
        select id,
               name,
               father,
sys/src/test/java/com/yuanchu/limslaboratory/SysApplicationTests.java
@@ -1,6 +1,5 @@
package com.yuanchu.limslaboratory;
import com.yuanchu.limslaboratory.pojo.vo.PlanVo;
import com.yuanchu.limslaboratory.service.PlanService;
import com.yuanchu.limslaboratory.service.UserService;
import com.yuanchu.limslaboratory.utils.MyUtil;
@@ -8,20 +7,15 @@
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@SpringBootTest
class SysApplicationTests {
user-server/src/main/java/com/yuanchu/limslaboratory/mapper/UserMapper.java
@@ -26,5 +26,7 @@
    IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page);
    List<Map> selectUser();
    List<Map<String,Object>> selectUser();
}
user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java
@@ -75,7 +75,7 @@
     * æŸ¥è¯¢æ‰€æœ‰ç”¨æˆ·ä¿¡æ¯
     * @return
     */
    List<Map> selectUser();
    List<Map<String,Object>> selectUser();
    /**
     * èŽ·å–æ‰€æœ‰ç”¨æˆ·çš„åç§°ä¸ŽId
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java
@@ -75,7 +75,7 @@
    }
    @Override
    public List<Map> selectUser() {
    public List<Map<String,Object>> selectUser() {
        return userMapper.selectUser();
    }