package org.jeecg.modules.tms.service.impl; import org.jeecg.modules.tms.entity.TmsToolScrap; import org.jeecg.modules.tms.entity.TmsToolScrapDetail; import org.jeecg.modules.tms.mapper.TmsToolScrapDetailMapper; import org.jeecg.modules.tms.mapper.TmsToolScrapMapper; import org.jeecg.modules.tms.service.ITmsToolScrapService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.io.Serializable; import java.util.List; import java.util.Collection; /** * @Description: 工装报废 * @Author: jeecg-boot * @Date: 2025-07-28 * @Version: V1.0 */ @Service public class TmsToolScrapServiceImpl extends ServiceImpl implements ITmsToolScrapService { @Autowired private TmsToolScrapMapper tmsToolScrapMapper; @Autowired private TmsToolScrapDetailMapper tmsToolScrapDetailMapper; @Override @Transactional(rollbackFor = Exception.class) public void delMain(String id) { tmsToolScrapDetailMapper.deleteByMainId(id); tmsToolScrapMapper.deleteById(id); } @Override @Transactional(rollbackFor = Exception.class) public void delBatchMain(Collection idList) { for(Serializable id:idList) { tmsToolScrapDetailMapper.deleteByMainId(id.toString()); tmsToolScrapMapper.deleteById(id); } } }