wujian
2024-02-22 3f9c539cc52e8c59e30b364674b21b7b4e790c20
提交 | 用户 | 时间
268beb 1 package com.jcdm.main.bs.formulaChild.service.impl;
W 2
3 import java.util.List;
4
3f9c53 5 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
268beb 6 import com.jcdm.common.core.domain.AjaxResult;
W 7 import com.jcdm.common.utils.DateUtils;
3f9c53 8 import com.jcdm.main.bs.formula.mapper.BsFormulaInfoMapper;
268beb 9 import org.springframework.beans.factory.annotation.Autowired;
W 10 import org.springframework.stereotype.Service;
11 import com.jcdm.main.bs.formulaChild.mapper.BsFormulaChildInfoMapper;
12 import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo;
13 import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService;
14
15 /**
16  * 配方配置子信息Service业务层处理
17  * 
18  * @author ruimin
19  * @date 2023-12-26
20  */
21 @Service
3f9c53 22 public class BsFormulaChildInfoServiceImpl extends ServiceImpl<BsFormulaChildInfoMapper,BsFormulaChildInfo> implements IBsFormulaChildInfoService
268beb 23 {
W 24     @Autowired
25     private BsFormulaChildInfoMapper bsFormulaChildInfoMapper;
26
27     /**
28      * 查询配方配置子信息
29      * 
30      * @param id 配方配置子信息主键
31      * @return 配方配置子信息
32      */
33     @Override
34     public BsFormulaChildInfo selectBsFormulaChildInfoById(Long id)
35     {
36         return bsFormulaChildInfoMapper.selectBsFormulaChildInfoById(id);
37     }
38
39     /**
40      * 查询配方配置子信息列表
41      * 
42      * @param bsFormulaChildInfo 配方配置子信息
43      * @return 配方配置子信息
44      */
45     @Override
46     public List<BsFormulaChildInfo> selectBsFormulaChildInfoList(BsFormulaChildInfo bsFormulaChildInfo)
47     {
48         return bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo);
49     }
50
51     /**
52      * 新增配方配置子信息
53      * 
54      * @param bsFormulaChildInfo 配方配置子信息
55      * @return 结果
56      */
57     @Override
58     public int insertBsFormulaChildInfo(BsFormulaChildInfo bsFormulaChildInfo)
59     {
60         bsFormulaChildInfo.setCreateTime(DateUtils.getNowDate());
61         return bsFormulaChildInfoMapper.insertBsFormulaChildInfo(bsFormulaChildInfo);
62     }
63
64     /**
65      * 修改配方配置子信息
66      * 
67      * @param bsFormulaChildInfo 配方配置子信息
68      * @return 结果
69      */
70     @Override
71     public int updateBsFormulaChildInfo(BsFormulaChildInfo bsFormulaChildInfo)
72     {
73         bsFormulaChildInfo.setUpdateTime(DateUtils.getNowDate());
74         return bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
75     }
76
77     /**
78      * 批量删除配方配置子信息
79      * 
80      * @param ids 需要删除的配方配置子信息主键
81      * @return 结果
82      */
83     @Override
84     public int deleteBsFormulaChildInfoByIds(Long[] ids)
85     {
86         return bsFormulaChildInfoMapper.deleteBsFormulaChildInfoByIds(ids);
87     }
88
89     /**
90      * 删除配方配置子信息信息
91      * 
92      * @param id 配方配置子信息主键
93      * @return 结果
94      */
95     @Override
96     public int deleteBsFormulaChildInfoById(Long id)
97     {
98         return bsFormulaChildInfoMapper.deleteBsFormulaChildInfoById(id);
99     }
100
101     @Override
102     public BsFormulaChildInfo selectBsFormulaChildInfoByTypeTopOne(String type,String productCode,String processesCode) {
103         BsFormulaChildInfo info = new BsFormulaChildInfo();
104         info.setOperationType(type);
105         info.setProcessesCode(processesCode);
106         info.setProductCode(productCode);
107         return bsFormulaChildInfoMapper.selectBsFormulaChildInfoByTypeTopOne(info);
108     }
109
110     @Override
111     public List<BsFormulaChildInfo> releaseCheck(BsFormulaChildInfo bsFormulaChildInfo) {
112         return bsFormulaChildInfoMapper.releaseCheck(bsFormulaChildInfo);
113     }
114
115     @Override
116     public AjaxResult updateResults(BsFormulaChildInfo bsFormulaChildInfo) {
117         List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo);
118         if(bsFormulaChildInfos.size()>0){
119             bsFormulaChildInfos.get(0).setResults("OK");
120             bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0));
121         }else {
122             return AjaxResult.error("非本工位物料,请重新扫描");
123         }
124         return AjaxResult.success("成功");
125     }
126
127     @Override
128     public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
129         bsFormulaChildInfoMapper.workpieceRelease(bsFormulaChildInfo);
130         return AjaxResult.success();
131     }
132 }