hdy
2025-02-27 bf5dcc46de28c2ca664be4c6c3566e0a82c1ecd6
提交 | 用户 | 时间
fb3b3e 1 package com.billion.main.bs.service.impl;
2
3 import java.util.Date;
4 import java.util.List;
5
6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 import com.billion.common.core.domain.entity.SysUser;
8 import com.billion.common.core.domain.model.LoginUser;
9 import com.billion.common.utils.DateUtils;
10 import com.billion.common.utils.SecurityUtils;
11 import com.billion.main.bs.domain.BsFormulaChildInfo;
12 import com.billion.main.bs.mapper.BsFormulaChildInfoMapper;
13 import com.billion.main.bs.service.IBsFormulaChildInfoService;
14 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.stereotype.Service;
16
17 /**
18  * 配方配置子信息Service业务层处理
19  * 
20  * @author Billion
21  * @date 2024-11-26
22  */
23 @Service
24 public class BsFormulaChildInfoServiceImpl extends ServiceImpl<BsFormulaChildInfoMapper, BsFormulaChildInfo> implements IBsFormulaChildInfoService
25 {
26     @Autowired
27     private BsFormulaChildInfoMapper bsFormulaChildInfoMapper;
28
29     /**
30      * 查询配方配置子信息
31      * 
32      * @param id 配方配置子信息主键
33      * @return 配方配置子信息
34      */
35     @Override
36     public BsFormulaChildInfo selectBsFormulaChildInfoById(Long id)
37     {
38         return bsFormulaChildInfoMapper.selectBsFormulaChildInfoById(id);
39     }
40
41     /**
42      * 查询配方配置子信息列表
43      * 
44      * @param bsFormulaChildInfo 配方配置子信息
45      * @return 配方配置子信息
46      */
47     @Override
48     public List<BsFormulaChildInfo> selectBsFormulaChildInfoList(BsFormulaChildInfo bsFormulaChildInfo)
49     {
50         return bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo);
51     }
52
53     /**
54      * 新增配方配置子信息
55      * 
56      * @param bsFormulaChildInfo 配方配置子信息
57      * @return 结果
58      */
59     @Override
60     public int insertBsFormulaChildInfo(BsFormulaChildInfo bsFormulaChildInfo)
61     {
62         bsFormulaChildInfo.setCreateTime(DateUtils.getNowDate());
63         LoginUser loginUser = SecurityUtils.getLoginUser();
64         SysUser user = loginUser.getUser();
65         bsFormulaChildInfo.setCreateTime(new Date());
66         bsFormulaChildInfo.setUpdateTime(new Date());
67         bsFormulaChildInfo.setCreateBy(user.getUserName());
68         bsFormulaChildInfo.setUpdateBy(user.getUserName());
69         return bsFormulaChildInfoMapper.insertBsFormulaChildInfo(bsFormulaChildInfo);
70     }
71
72     /**
73      * 修改配方配置子信息
74      * 
75      * @param bsFormulaChildInfo 配方配置子信息
76      * @return 结果
77      */
78     @Override
79     public int updateBsFormulaChildInfo(BsFormulaChildInfo bsFormulaChildInfo)
80     {
81         bsFormulaChildInfo.setUpdateTime(DateUtils.getNowDate());
82         LoginUser loginUser = SecurityUtils.getLoginUser();
83         SysUser user = loginUser.getUser();
84         bsFormulaChildInfo.setUpdateBy(user.getUserName());
85         return bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
86     }
87
88     /**
89      * 批量删除配方配置子信息
90      * 
91      * @param ids 需要删除的配方配置子信息主键
92      * @return 结果
93      */
94     @Override
95     public int deleteBsFormulaChildInfoByIds(Long[] ids)
96     {
97         return bsFormulaChildInfoMapper.deleteBsFormulaChildInfoByIds(ids);
98     }
99
100     /**
101      * 删除配方配置子信息信息
102      * 
103      * @param id 配方配置子信息主键
104      * @return 结果
105      */
106     @Override
107     public int deleteBsFormulaChildInfoById(Long id)
108     {
109         return bsFormulaChildInfoMapper.deleteBsFormulaChildInfoById(id);
110     }
111 }