新火炬后端单体项目初始化代码
Lius
8 天以前 9af27ed8da6b5710025fb080f96a7dd9e80467a4
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
package org.jeecg.modules.tms.service.impl;
 
import org.jeecg.modules.tms.entity.TmsToolStocktaking;
import org.jeecg.modules.tms.entity.TmsToolStocktakingDetail;
import org.jeecg.modules.tms.mapper.TmsToolStocktakingDetailMapper;
import org.jeecg.modules.tms.mapper.TmsToolStocktakingMapper;
import org.jeecg.modules.tms.service.ITmsToolStocktakingService;
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 TmsToolStocktakingServiceImpl extends ServiceImpl<TmsToolStocktakingMapper, TmsToolStocktaking> implements ITmsToolStocktakingService {
 
    @Autowired
    private TmsToolStocktakingMapper tmsToolStocktakingMapper;
    @Autowired
    private TmsToolStocktakingDetailMapper tmsToolStocktakingDetailMapper;
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delMain(String id) {
        tmsToolStocktakingDetailMapper.deleteByMainId(id);
        tmsToolStocktakingMapper.deleteById(id);
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delBatchMain(Collection<? extends Serializable> idList) {
        for(Serializable id:idList) {
            tmsToolStocktakingDetailMapper.deleteByMainId(id.toString());
            tmsToolStocktakingMapper.deleteById(id);
        }
    }
    
}