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