zss
2023-09-15 cd5b5908546c3d6c98e7aec607af8db1f8565495
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java
@@ -1,8 +1,11 @@
package com.yuanchu.mom.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yuanchu.mom.mapper.InspectionItemMapper;
import com.yuanchu.mom.mapper.TechniqueMapper;
import com.yuanchu.mom.pojo.InspectionItem;
import com.yuanchu.mom.pojo.RawInsProduct;
import com.yuanchu.mom.pojo.dto.InspectionItemDto;
import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto;
import com.yuanchu.mom.service.DeviceService;
@@ -38,8 +41,8 @@
    //新增按钮-->2、查询所有检验项目
    @Override
    public List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type) {
        return inspectionItemMapper.selectInspectionItem(finishInspectId,type);
    public List<InspectionItemDto> selectInspectionItem(Integer id, Integer type) {
        return inspectionItemMapper.selectInspectionItem(id,type);
    }
@@ -49,6 +52,18 @@
        //该工艺id下生产工艺最新版本
        Integer ver = techniqueMapper.selectVerByTeId(technologyId).get(0);
        return techniqueMapper.selDevByVerTecIdFaNam(technologyId, father, name, ver);
    }
    //更改设备
    @Override
    public void updateDevByInsId(Integer id, Integer type, Integer devId) {
        LambdaUpdateWrapper<InspectionItem> updateWrapper = Wrappers.<InspectionItem>lambdaUpdate()
                .eq(InspectionItem::getId, id)
                .eq(InspectionItem::getType, type)
                .set(InspectionItem::getDeviceId, devId)
                .set(InspectionItem::getInspectionValue, null)
                .set(InspectionItem::getResult, null);
        inspectionItemMapper.update(new InspectionItem(), updateWrapper);
    }
    //新增按钮-->2、检验项目-->失去焦点发起该请求
@@ -68,6 +83,7 @@
        } else {
            inspectionItem.setResult(1);
        }
        inspectionItem.setUsername(username);
        inspectionItemMapper.updateById(inspectionItem);
        //返回检验项目的结论
        return inspectionItem.getResult();