XiaoRuby
2023-07-26 30f6da8bf0143906b42fa600f6a604cea6c81f71
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
@@ -29,17 +29,18 @@
    @Resource
    private InspectionMapper inspectionMapper;
    @Resource
    private PlanMapper planMapper;
    @Resource
    InspectionMaterialListMapper inspectionMaterialListMapper;
    //添加检验申请单
    @Override
    public Inspection addInspection(String userName,int type) {
        Inspection inspection = new Inspection(type, 0,1,1, userName);
        System.out.println(inspection);
        int judge = inspectionMapper.insert(inspection);
        System.out.println(judge);
        return judge>0?inspection:null;
    }
@@ -56,7 +57,7 @@
        Inspection inspection = inspectionMapper.selectById(inspectionId);
        inspection.setState(0);
        int judge1 = inspectionMapper.updateById(inspection);
        //检验样品作废
        //检验样品作废(根据报检单id删除样品信息)
        UpdateWrapper<InspectionMaterialList> wrapper = new UpdateWrapper<>();
        wrapper.eq("inspection_id", inspectionId).set("state", 0);
        int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(),wrapper);