懒羊羊
2024-01-31 e57a8990ae56f657a59c435a0613c5f7a8728003
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package com.jcdm.main.bs.technologyRoute.service.impl;
 
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo;
import com.jcdm.main.bs.technologyRoute.domain.BsTechnologyRouteInfo;
import com.jcdm.main.bs.technologyRoute.mapper.BsTechnologyRouteInfoMapper;
import com.jcdm.main.bs.technologyRoute.service.IBsTechnologyRouteInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo;
 
import static org.apache.commons.lang3.SystemUtils.getUserName;
 
/**
 * 工艺流程Service业务层处理
 * 
 * @author ruimin
 * @date 2023-12-09
 */
@Service
public class BsTechnologyRouteInfoServiceImpl implements IBsTechnologyRouteInfoService
{
    @Autowired
    private BsTechnologyRouteInfoMapper bsTechnologyRouteInfoMapper;
 
 
    @Autowired
    private com.jcdm.main.bs.mapper.BsTechnologyRouteChildInfoMapper bsTechnologyRouteChildInfoMapper;
 
    /**
     * 查询工艺流程
     * 
     * @param id 工艺流程主键
     * @return 工艺流程
     */
    @Override
    public BsTechnologyRouteInfo selectBsTechnologyRouteInfoById(Long id)
    {
        return bsTechnologyRouteInfoMapper.selectBsTechnologyRouteInfoById(id);
    }
 
    /**
     * 查询工艺流程列表
     * 
     * @param bsTechnologyRouteInfo 工艺流程
     * @return 工艺流程
     */
    @Override
    public List<BsTechnologyRouteInfo> selectBsTechnologyRouteInfoList(BsTechnologyRouteInfo bsTechnologyRouteInfo)
    {
        return bsTechnologyRouteInfoMapper.selectBsTechnologyRouteInfoList(bsTechnologyRouteInfo);
    }
 
    /**
     * 新增工艺流程
     * 
     * @param bsTechnologyRouteInfo 工艺流程
     * @return 结果
     */
    @Override
    public int insertBsTechnologyRouteInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo)
    {
        bsTechnologyRouteInfo.setCreateTime(DateUtils.getNowDate());
        bsTechnologyRouteInfo.setCreateUser(getUserName());
        return bsTechnologyRouteInfoMapper.insertBsTechnologyRouteInfo(bsTechnologyRouteInfo);
    }
 
    /**
     * 修改工艺流程
     * 
     * @param bsTechnologyRouteInfo 工艺流程
     * @return 结果
     */
    @Override
    public int updateBsTechnologyRouteInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo)
    {
        bsTechnologyRouteInfo.setUpdateTime(DateUtils.getNowDate());
        bsTechnologyRouteInfo.setUpdateUser(getUserName());
        return bsTechnologyRouteInfoMapper.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo);
    }
 
    /**
     * 批量删除工艺流程
     * 
     * @param ids 需要删除的工艺流程主键
     * @return 结果
     */
    @Override
    public int deleteBsTechnologyRouteInfoByIds(Long[] ids)
    {
        return bsTechnologyRouteInfoMapper.deleteBsTechnologyRouteInfoByIds(ids);
    }
 
    /**
     * 删除工艺流程信息
     * 
     * @param id 工艺流程主键
     * @return 结果
     */
    @Override
    public int deleteBsTechnologyRouteInfoById(Long id)
    {
        return bsTechnologyRouteInfoMapper.deleteBsTechnologyRouteInfoById(id);
    }
 
    @Override
    public int updateBsTechnologyRouteAndChildInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo) {
        int i = this.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo);
        com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo  bsTechnologyRouteChildInfo = new com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo();
        bsTechnologyRouteChildInfo.setId(bsTechnologyRouteInfo.getId());
        List<BsTechnologyRouteChildInfo> bsTechnologyRouteChildInfos = bsTechnologyRouteChildInfoMapper.selectBsTechnologyRouteChildInfoList(bsTechnologyRouteChildInfo);
        for (com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo technologyRouteChildInfo : bsTechnologyRouteChildInfos) {
            technologyRouteChildInfo.setRouteCode(bsTechnologyRouteInfo.getRouteCode());
            int i1 = bsTechnologyRouteChildInfoMapper.updateBsTechnologyRouteChildByCodeInfo(technologyRouteChildInfo);
        }
        return i;
    }
}