春风项目四线(合箱线、总装线)
wujian
2024-04-27 f4cb4dab73beecc4c03a52f8d971e007c9c287f9
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.bs.workshop.service.impl;
2
3 import java.util.List;
b6c635 4
5 import com.jcdm.common.core.domain.entity.SysUser;
6 import com.jcdm.common.exception.ServiceException;
fd2207 7 import com.jcdm.common.utils.DateUtils;
b6c635 8 import com.jcdm.common.utils.SecurityUtils;
9 import com.jcdm.common.utils.StringUtils;
10 import com.jcdm.common.utils.bean.BeanValidators;
fd2207 11 import com.jcdm.main.bs.workshop.service.IBsWorkshopInfoService;
12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Service;
14 import com.jcdm.main.bs.workshop.mapper.BsWorkshopInfoMapper;
15 import com.jcdm.main.bs.workshop.domain.BsWorkshopInfo;
16
17 import static org.apache.commons.lang3.SystemUtils.getUserName;
18
19 /**
20  * 车间信息Service业务层处理
21  * 
22  * @author jc
23  * @date 2023-12-06
24  */
25 @Service
26 public class BsWorkshopInfoServiceImpl implements IBsWorkshopInfoService
27 {
28     @Autowired
29     private BsWorkshopInfoMapper bsWorkshopInfoMapper;
30
31     /**
32      * 查询车间信息
33      * 
34      * @param id 车间信息主键
35      * @return 车间信息
36      */
37     @Override
38     public BsWorkshopInfo selectBsWorkshopInfoById(Long id)
39     {
40         return bsWorkshopInfoMapper.selectBsWorkshopInfoById(id);
41     }
42
43     /**
44      * 查询车间信息列表
45      * 
46      * @param bsWorkshopInfo 车间信息
47      * @return 车间信息
48      */
49     @Override
50     public List<BsWorkshopInfo> selectBsWorkshopInfoList(BsWorkshopInfo bsWorkshopInfo)
51     {
52         return bsWorkshopInfoMapper.selectBsWorkshopInfoList(bsWorkshopInfo);
53     }
54
55     /**
56      * 新增车间信息
57      * 
58      * @param bsWorkshopInfo 车间信息
59      * @return 结果
60      */
61     @Override
62     public int insertBsWorkshopInfo(BsWorkshopInfo bsWorkshopInfo)
63     {
64         bsWorkshopInfo.setCreateTime(DateUtils.getNowDate());
65         bsWorkshopInfo.setCreateUser(getUserName());
66         return bsWorkshopInfoMapper.insertBsWorkshopInfo(bsWorkshopInfo);
67     }
68
69     /**
70      * 修改车间信息
71      * 
72      * @param bsWorkshopInfo 车间信息
73      * @return 结果
74      */
75     @Override
76     public int updateBsWorkshopInfo(BsWorkshopInfo bsWorkshopInfo)
77     {
78         bsWorkshopInfo.setUpdateTime(DateUtils.getNowDate());
79         bsWorkshopInfo.setUpdateUser(getUserName());
80         return bsWorkshopInfoMapper.updateBsWorkshopInfo(bsWorkshopInfo);
81     }
82
83     /**
84      * 批量删除车间信息
85      * 
86      * @param ids 需要删除的车间信息主键
87      * @return 结果
88      */
89     @Override
90     public int deleteBsWorkshopInfoByIds(Long[] ids)
91     {
92         return bsWorkshopInfoMapper.deleteBsWorkshopInfoByIds(ids);
93     }
94
95     /**
96      * 删除车间信息信息
97      * 
98      * @param id 车间信息主键
99      * @return 结果
100      */
101     @Override
102     public int deleteBsWorkshopInfoById(Long id)
103     {
104         return bsWorkshopInfoMapper.deleteBsWorkshopInfoById(id);
105     }
b6c635 106
107     @Override
108     public String importWrokshop(List<BsWorkshopInfo> userList, Boolean isUpdateSupport, String operName) {
109         StringBuilder successMsg = new StringBuilder();
110         for (BsWorkshopInfo info : userList) {
111             insertBsWorkshopInfo(info);
112             successMsg.append("<br/>" + info.getWorkshopName() + " 导入成功");
113         }
114         return successMsg.toString();
115     }
116
117
fd2207 118 }