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