春风项目四线(合箱线、总装线)
jiang
2024-01-30 d82e4465e5e3c9e9f93a8ce7ce3b8c0f73fdf991
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.bs.technologyRoute.service.impl;
2
3 import java.util.List;
4 import com.jcdm.common.utils.DateUtils;
5 import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo;
6 import com.jcdm.main.bs.technologyRoute.domain.BsTechnologyRouteInfo;
7 import com.jcdm.main.bs.technologyRoute.mapper.BsTechnologyRouteInfoMapper;
8 import com.jcdm.main.bs.technologyRoute.service.IBsTechnologyRouteInfoService;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11 import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo;
12
13 import static org.apache.commons.lang3.SystemUtils.getUserName;
14
15 /**
16  * 工艺流程Service业务层处理
17  * 
18  * @author ruimin
19  * @date 2023-12-09
20  */
21 @Service
22 public class BsTechnologyRouteInfoServiceImpl implements IBsTechnologyRouteInfoService
23 {
24     @Autowired
25     private BsTechnologyRouteInfoMapper bsTechnologyRouteInfoMapper;
26
27
28     @Autowired
29     private com.jcdm.main.bs.mapper.BsTechnologyRouteChildInfoMapper bsTechnologyRouteChildInfoMapper;
30
31     /**
32      * 查询工艺流程
33      * 
34      * @param id 工艺流程主键
35      * @return 工艺流程
36      */
37     @Override
38     public BsTechnologyRouteInfo selectBsTechnologyRouteInfoById(Long id)
39     {
40         return bsTechnologyRouteInfoMapper.selectBsTechnologyRouteInfoById(id);
41     }
42
43     /**
44      * 查询工艺流程列表
45      * 
46      * @param bsTechnologyRouteInfo 工艺流程
47      * @return 工艺流程
48      */
49     @Override
50     public List<BsTechnologyRouteInfo> selectBsTechnologyRouteInfoList(BsTechnologyRouteInfo bsTechnologyRouteInfo)
51     {
52         return bsTechnologyRouteInfoMapper.selectBsTechnologyRouteInfoList(bsTechnologyRouteInfo);
53     }
54
55     /**
56      * 新增工艺流程
57      * 
58      * @param bsTechnologyRouteInfo 工艺流程
59      * @return 结果
60      */
61     @Override
62     public int insertBsTechnologyRouteInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo)
63     {
64         bsTechnologyRouteInfo.setCreateTime(DateUtils.getNowDate());
65         bsTechnologyRouteInfo.setCreateUser(getUserName());
66         return bsTechnologyRouteInfoMapper.insertBsTechnologyRouteInfo(bsTechnologyRouteInfo);
67     }
68
69     /**
70      * 修改工艺流程
71      * 
72      * @param bsTechnologyRouteInfo 工艺流程
73      * @return 结果
74      */
75     @Override
76     public int updateBsTechnologyRouteInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo)
77     {
78         bsTechnologyRouteInfo.setUpdateTime(DateUtils.getNowDate());
79         bsTechnologyRouteInfo.setUpdateUser(getUserName());
80         return bsTechnologyRouteInfoMapper.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo);
81     }
82
83     /**
84      * 批量删除工艺流程
85      * 
86      * @param ids 需要删除的工艺流程主键
87      * @return 结果
88      */
89     @Override
90     public int deleteBsTechnologyRouteInfoByIds(Long[] ids)
91     {
92         return bsTechnologyRouteInfoMapper.deleteBsTechnologyRouteInfoByIds(ids);
93     }
94
95     /**
96      * 删除工艺流程信息
97      * 
98      * @param id 工艺流程主键
99      * @return 结果
100      */
101     @Override
102     public int deleteBsTechnologyRouteInfoById(Long id)
103     {
104         return bsTechnologyRouteInfoMapper.deleteBsTechnologyRouteInfoById(id);
105     }
106
107     @Override
108     public int updateBsTechnologyRouteAndChildInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo) {
109         int i = this.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo);
110         com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo  bsTechnologyRouteChildInfo = new com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo();
111         bsTechnologyRouteChildInfo.setId(bsTechnologyRouteInfo.getId());
112         List<BsTechnologyRouteChildInfo> bsTechnologyRouteChildInfos = bsTechnologyRouteChildInfoMapper.selectBsTechnologyRouteChildInfoList(bsTechnologyRouteChildInfo);
113         for (com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo technologyRouteChildInfo : bsTechnologyRouteChildInfos) {
114             technologyRouteChildInfo.setRouteCode(bsTechnologyRouteInfo.getRouteCode());
115             int i1 = bsTechnologyRouteChildInfoMapper.updateBsTechnologyRouteChildByCodeInfo(technologyRouteChildInfo);
116         }
117         return i;
118     }
119 }