XiaoRuby
2023-07-26 30f6da8bf0143906b42fa600f6a604cea6c81f71
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.yuanchu.limslaboratory.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.mapper.InspectionRecordsMapper;
import com.yuanchu.limslaboratory.pojo.InspectionRecords;
import com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto;
import com.yuanchu.limslaboratory.service.InspectionRecordsService;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.sql.Wrapper;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
 
/**
 * 检测记录(InspectionRecords)表服务实现类
 *
 * @author zss
 * @since 2023-07-24 14:05:12
 */
@Service("inspectionRecordsService")
public class InspectionRecordsServiceImpl extends ServiceImpl<InspectionRecordsMapper, InspectionRecords> implements InspectionRecordsService {
 
    @Resource
    InspectionRecordsMapper inspectionRecordsMapper;
 
    //根据样品编号id以及状态(待提交)查询检测记录
    @Override
    public InspectionRecordsDto selectByProductId(Integer productId, Integer submitState) {
        //状态为空的时候默认为待提交
        if (submitState==null){
            submitState=0;
        }
        return inspectionRecordsMapper.selectByProductId(productId,submitState);
    }
 
    //根据样品编号id以及状态(待提交)修改检测记录
    @Override
    public void upByProductId(InspectionRecordsDto inspectionRecordsDto) {
        //???
    }
 
    //根据检验记录id修改提交状态
    @Override
    public void submitRecords(Integer id) {
        //更新检验记录表
        InspectionRecords inspectionRecords = inspectionRecordsMapper.selectById(id);
        inspectionRecords.setSubmitState(1);
        inspectionRecords.setUpdateTime(LocalDateTime.now());
        inspectionRecordsMapper.updateById(inspectionRecords);
        //新增一个检验报告
    }
 
}