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