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