WaveMasterService.java
1.92 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
package com.huaheng.pc.config.waveMaster.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.common.exception.service.ServiceException;
import com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail;
import com.huaheng.pc.config.waveFlowDetail.mapper.WaveFlowDetailMapper;
import com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader;
import com.huaheng.pc.config.waveFlowHeader.mapper.WaveFlowHeaderMapper;
import com.huaheng.pc.config.waveMaster.domain.WaveMaster;
import com.huaheng.pc.config.waveMaster.mapper.WaveMasterMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
public class WaveMasterService extends ServiceImpl<WaveMasterMapper, WaveMaster> {
@Resource
private WaveMasterMapper waveMasterMapper;
@Resource
private WaveFlowHeaderMapper waveFlowHeaderMapper;
@Resource
private WaveFlowDetailMapper waveFlowDetailMapper;
//复制波次配置
@Transactional
public Boolean waveMasterCopy(String code,String newCode){
int i = 0;
//复制波次配置
i = waveMasterMapper.waveMasterCopy(code,newCode);
if(i < 1){
throw new ServiceException("复制菜单数据失败");
}
//复制波次流程主表
i = waveFlowHeaderMapper.waveFlowHeaderCopy(code,newCode);
if(i < 1){
throw new ServiceException("复制菜单数据失败");
}
//复制波次流程明细
i = waveFlowDetailMapper.waveFlowDetailCopy(code,newCode);
if(i < 1){
throw new ServiceException("复制菜单数据失败");
}
//修改波次流程明细headerId
i = waveFlowDetailMapper.updateHeaderId(newCode);
if(i < 1){
throw new ServiceException("复制菜单数据失败");
}
return true;
}
}