/* * Copyright (c) 2018-2025, ztt All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the pig4cloud.com developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: ztt */ package com.chinaztt.mes.quality.service.impl; import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.chinaztt.mes.quality.dto.PartsDTO; import com.chinaztt.mes.quality.entity.*; import com.chinaztt.mes.quality.mapper.*; import com.chinaztt.mes.quality.service.PartsService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.util.List; /** * 零件检测 * * @author liuth * @date 2020-10-14 10:54:02 */ @Service @AllArgsConstructor public class PartsServiceImpl extends ServiceImpl implements PartsService { private RequirementsMapper requirementsMapper; private ItemsMapper itemsMapper; private TemplateMapper templateMapper; private TaskMapper taskMapper; @Override @Transactional(rollbackFor = Exception.class) public boolean fullDelete(Long id) { requirementsMapper.delete(Wrappers.lambdaQuery().eq(Requirements::getPartId,id)); baseMapper.delete(Wrappers.lambdaQuery().eq(Parts::getPartId,id)); return true; } @Override public PartsDTO getFullById(Long id) { PartsDTO partsDTO = new PartsDTO(); //当不为空时获取零件检测信息 if (id != 0L) { // 1.获取检测零件基本信息 partsDTO = baseMapper.selectDtoById(id); //获取对应的检测模板信息 List