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