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