Commit 773ecbd61e7d04d8aee5ad8124096125f17a3de4
1 parent
30838149
修改定时删除接口日志
Showing
7 changed files
with
96 additions
and
77 deletions
src/main/java/com/huaheng/api/general/service/ReceiptApiService.java
... | ... | @@ -358,6 +358,14 @@ public class ReceiptApiService { |
358 | 358 | return AjaxResult.error("托盘锁定有任务了,或托盘有对应库位了"); |
359 | 359 | } |
360 | 360 | |
361 | +// //校验入库组盘 | |
362 | +// List<ReceiptContainerHeader> list = receiptContainerHeaderService.list(new LambdaQueryWrapper<ReceiptContainerHeader>() | |
363 | +// .eq(ReceiptContainerHeader::getContainerCode, containerCode) | |
364 | +// .ne(ReceiptContainerHeader::getStatus, 20)); | |
365 | +// if (list.size() > 0) { | |
366 | +// return AjaxResult.error(containerCode + ",该托盘有入库组盘未完成,请取消或完成任务"); | |
367 | +// } | |
368 | + | |
361 | 369 | return AjaxResult.success(""); |
362 | 370 | } |
363 | 371 | |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailService.java
... | ... | @@ -10,7 +10,7 @@ import com.huaheng.pc.task.taskDetail.domain.TaskDetail; |
10 | 10 | |
11 | 11 | import java.util.List; |
12 | 12 | |
13 | -public interface ReceiptDetailService extends IService<ReceiptDetail>{ | |
13 | +public interface ReceiptDetailService extends IService<ReceiptDetail> { | |
14 | 14 | |
15 | 15 | AjaxResult saveReceiptDetaial(ReceiptDetail receiptDetail); |
16 | 16 | |
... | ... | @@ -18,6 +18,7 @@ public interface ReceiptDetailService extends IService<ReceiptDetail>{ |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * 根据流程配置更新入库明细下一流程 |
21 | + * | |
21 | 22 | * @param receiptDetail |
22 | 23 | * @return |
23 | 24 | */ |
... | ... | @@ -27,10 +28,10 @@ public interface ReceiptDetailService extends IService<ReceiptDetail>{ |
27 | 28 | List<StatusFlowDetail> queryflow(); |
28 | 29 | |
29 | 30 | /** |
31 | + * @param id 头表id | |
30 | 32 | * @description 更新头表尾状态 |
31 | 33 | * 每次明细表更新后调用该方法 |
32 | 34 | * 当所有明细表到达该状态时,更新头表状态 |
33 | - * @param id 头表id | |
34 | 35 | */ |
35 | 36 | void updateReceiptHeaderLastStatus(Integer id); |
36 | 37 | |
... | ... | @@ -48,6 +49,7 @@ public interface ReceiptDetailService extends IService<ReceiptDetail>{ |
48 | 49 | |
49 | 50 | /** |
50 | 51 | * 移动端扫描入库单 |
52 | + * | |
51 | 53 | * @param code |
52 | 54 | * @return |
53 | 55 | */ |
... | ... | @@ -55,10 +57,11 @@ public interface ReceiptDetailService extends IService<ReceiptDetail>{ |
55 | 57 | |
56 | 58 | List<Integer> insertTodayReceiptDetail(int headerId, List<ReceiptBill> receiptBills, boolean isCompletedQty, String companyCode); |
57 | 59 | |
58 | - AjaxResult updateReceiptHeader(ReceiptHeader receiptHeader); | |
60 | + AjaxResult updateReceiptHeader(ReceiptHeader receiptHeader); | |
59 | 61 | |
60 | 62 | /** |
61 | 63 | * 根据入库单头表id查询入库单明细 |
64 | + * | |
62 | 65 | * @param headerId |
63 | 66 | * @return |
64 | 67 | */ |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.receipt.receiptDetail.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | 6 | import com.huaheng.common.constant.QuantityConstant; |
6 | 7 | import com.huaheng.common.exception.service.ServiceException; |
7 | 8 | import com.huaheng.common.support.Convert; |
... | ... | @@ -25,22 +26,22 @@ import com.huaheng.pc.config.receiptType.domain.ReceiptType; |
25 | 26 | import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; |
26 | 27 | import com.huaheng.pc.config.statusFlow.domain.StatusFlowDetail; |
27 | 28 | import com.huaheng.pc.config.statusFlow.service.StatusFlowDetailService; |
29 | +import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; | |
30 | +import com.huaheng.pc.receipt.receiptDetail.mapper.ReceiptDetailMapper; | |
28 | 31 | import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; |
29 | 32 | import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; |
30 | 33 | import com.huaheng.pc.system.dict.service.IDictDataService; |
31 | 34 | import com.huaheng.pc.task.taskDetail.domain.TaskDetail; |
32 | 35 | import org.springframework.stereotype.Service; |
36 | +import org.springframework.transaction.annotation.Transactional; | |
37 | + | |
33 | 38 | import javax.annotation.Resource; |
34 | 39 | import java.math.BigDecimal; |
35 | 40 | import java.util.ArrayList; |
36 | 41 | import java.util.List; |
37 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
38 | -import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; | |
39 | -import com.huaheng.pc.receipt.receiptDetail.mapper.ReceiptDetailMapper; | |
40 | -import org.springframework.transaction.annotation.Transactional; | |
41 | 42 | |
42 | 43 | @Service |
43 | -public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, ReceiptDetail> implements ReceiptDetailService{ | |
44 | +public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, ReceiptDetail> implements ReceiptDetailService { | |
44 | 45 | |
45 | 46 | @Resource |
46 | 47 | private MaterialService materialService; |
... | ... | @@ -67,21 +68,22 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
67 | 68 | |
68 | 69 | /** |
69 | 70 | * 新增入库明细 |
71 | + * | |
70 | 72 | * @param receiptDetail |
71 | 73 | * @return |
72 | 74 | */ |
73 | 75 | @Transactional(rollbackFor = Exception.class) |
74 | 76 | @Override |
75 | - public AjaxResult saveReceiptDetaial(ReceiptDetail receiptDetail){ | |
77 | + public AjaxResult saveReceiptDetaial(ReceiptDetail receiptDetail) { | |
76 | 78 | /* 判断入库头表状态*/ |
77 | 79 | LambdaQueryWrapper<ReceiptHeader> lambdaReceiptHeader = Wrappers.lambdaQuery(); |
78 | 80 | lambdaReceiptHeader.eq(ReceiptHeader::getId, receiptDetail.getReceiptId()); |
79 | 81 | ReceiptHeader receiptHeader = receiptHeaderService.getOne(lambdaReceiptHeader); |
80 | 82 | |
81 | 83 | //判断入库头表状态 |
82 | - if (receiptHeader == null ){ | |
84 | + if (receiptHeader == null) { | |
83 | 85 | throw new ServiceException("找不到主单据"); |
84 | - } else if (receiptHeader.getFirstStatus() > QuantityConstant.RECEIPT_HEADER_POOL){ | |
86 | + } else if (receiptHeader.getFirstStatus() > QuantityConstant.RECEIPT_HEADER_POOL) { | |
85 | 87 | throw new ServiceException("单据进入订单池后,不允许新增明细"); |
86 | 88 | } else if (receiptHeader.getFirstStatus() == 20) { |
87 | 89 | throw new ServiceException("单据已作废"); |
... | ... | @@ -124,6 +126,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
124 | 126 | |
125 | 127 | /** |
126 | 128 | * 修改入库明细 |
129 | + * | |
127 | 130 | * @param receiptDetail |
128 | 131 | * @return |
129 | 132 | */ |
... | ... | @@ -133,17 +136,17 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
133 | 136 | /* 先修改入库头表中的总数量和总行数,再更新记录,完成后更新入库头表中总数量和总行数*/ |
134 | 137 | |
135 | 138 | //查询原记录 |
136 | - ReceiptDetail originalReceiptDetail= this.getById(receiptDetail.getId()); | |
139 | + ReceiptDetail originalReceiptDetail = this.getById(receiptDetail.getId()); | |
137 | 140 | ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); |
138 | 141 | //判断物料编码是否被修改 |
139 | - if (!originalReceiptDetail.getMaterialCode().equals(receiptDetail.getMaterialCode())){ | |
142 | + if (!originalReceiptDetail.getMaterialCode().equals(receiptDetail.getMaterialCode())) { | |
140 | 143 | LambdaQueryWrapper<Material> lambdaMaterial = Wrappers.lambdaQuery(); |
141 | - lambdaMaterial.eq(Material::getCode,receiptDetail.getMaterialCode()); | |
144 | + lambdaMaterial.eq(Material::getCode, receiptDetail.getMaterialCode()); | |
142 | 145 | Material material = materialService.getOne(lambdaMaterial); |
143 | 146 | if (material == null) { |
144 | 147 | throw new ServiceException("该物料编码不存在"); |
145 | 148 | |
146 | - }else { | |
149 | + } else { | |
147 | 150 | receiptDetail.setMaterialName(material.getName()); |
148 | 151 | receiptDetail.setMaterialSpec(material.getSpec()); |
149 | 152 | receiptDetail.setMaterialUnit(material.getUnit()); |
... | ... | @@ -156,12 +159,12 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
156 | 159 | } |
157 | 160 | } |
158 | 161 | //如果单据状态为驳回则设置状态为提交审核 |
159 | - if ("10".equals(receiptDetail.getProcessStamp())){ | |
162 | + if ("10".equals(receiptDetail.getProcessStamp())) { | |
160 | 163 | receiptDetail.setProcessStamp("5"); |
161 | 164 | } |
162 | 165 | receiptDetail.setLastUpdatedBy(ShiroUtils.getName()); |
163 | 166 | receiptDetail.setLastUpdatedByName(ShiroUtils.getName()); |
164 | - if ( !this.updateById(receiptDetail) ){ | |
167 | + if (!this.updateById(receiptDetail)) { | |
165 | 168 | return AjaxResult.error("入库明细更新失败"); |
166 | 169 | } else { |
167 | 170 | |
... | ... | @@ -172,6 +175,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
172 | 175 | |
173 | 176 | /** |
174 | 177 | * 更新入库单头表状态 |
178 | + * | |
175 | 179 | * @param receiptHeader 入库单按头表 |
176 | 180 | * @return |
177 | 181 | */ |
... | ... | @@ -180,15 +184,15 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
180 | 184 | BigDecimal totalQty = new BigDecimal(0); |
181 | 185 | int totalLines = 0; |
182 | 186 | LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
183 | - receiptDetailLambdaQueryWrapper.eq(ReceiptDetail::getReceiptId,receiptHeader.getId()); | |
184 | - List<ReceiptDetail> receiptDetailList = list(receiptDetailLambdaQueryWrapper); | |
185 | - for(ReceiptDetail receiptDetail : receiptDetailList) { | |
187 | + receiptDetailLambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, receiptHeader.getId()); | |
188 | + List<ReceiptDetail> receiptDetailList = list(receiptDetailLambdaQueryWrapper); | |
189 | + for (ReceiptDetail receiptDetail : receiptDetailList) { | |
186 | 190 | totalLines++; |
187 | 191 | totalQty = totalQty.add(receiptDetail.getQty()); |
188 | 192 | } |
189 | 193 | receiptHeader.setTotalQty(totalQty); |
190 | 194 | receiptHeader.setTotalLines(totalLines); |
191 | - if (!receiptHeaderService.updateById(receiptHeader)){ | |
195 | + if (!receiptHeaderService.updateById(receiptHeader)) { | |
192 | 196 | return AjaxResult.error("入库头表更新失败"); |
193 | 197 | } |
194 | 198 | return AjaxResult.success("入库头表更新成功"); |
... | ... | @@ -203,23 +207,24 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
203 | 207 | |
204 | 208 | /** |
205 | 209 | * 根据流程配置更新入库明细下一流程 |
210 | + * | |
206 | 211 | * @param receiptDetail |
207 | 212 | * @return |
208 | 213 | */ |
209 | 214 | @Override |
210 | 215 | @Transactional(rollbackFor = Exception.class) |
211 | - public ReceiptDetail queryflow(ReceiptDetail receiptDetail){ | |
216 | + public ReceiptDetail queryflow(ReceiptDetail receiptDetail) { | |
212 | 217 | //当单据状态为驳回或作废时不更新状态 |
213 | - if (QuantityConstant.RECEIPT_HEADER_REJECTED.toString().equals(receiptDetail.getProcessStamp()) || QuantityConstant.RECEIPT_HEADER_OBSOLETE.toString().equals(receiptDetail.getProcessStamp())){ | |
218 | + if (QuantityConstant.RECEIPT_HEADER_REJECTED.toString().equals(receiptDetail.getProcessStamp()) || QuantityConstant.RECEIPT_HEADER_OBSOLETE.toString().equals(receiptDetail.getProcessStamp())) { | |
214 | 219 | return receiptDetail; |
215 | 220 | } |
216 | 221 | |
217 | 222 | //如果入库明细绑定了入库流程则从入库明细中选择流程 |
218 | - if ( StringUtils.isNotEmpty(receiptDetail.getStatusFlowCode())){ | |
223 | + if (StringUtils.isNotEmpty(receiptDetail.getStatusFlowCode())) { | |
219 | 224 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptDetail.getStatusFlowCode()); |
220 | 225 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
221 | 226 | //在状态到达时候是判断是否要质检 |
222 | - if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
227 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)) { | |
223 | 228 | receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); |
224 | 229 | } else { |
225 | 230 | receiptDetail.setProcessStamp(status); |
... | ... | @@ -239,29 +244,29 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
239 | 244 | |
240 | 245 | //查询头表中绑定的入库类型中的入库流程 |
241 | 246 | LambdaQueryWrapper<ReceiptType> lambdaReceiptType = Wrappers.lambdaQuery(); |
242 | - lambdaReceiptType.eq(ReceiptType::getCode, receiptHeader.getReceiptType()) | |
243 | - .eq(ReceiptType::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
247 | + lambdaReceiptType.eq(ReceiptType::getCode, receiptHeader.getReceiptType()) | |
248 | + .eq(ReceiptType::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
244 | 249 | .eq(ReceiptType::getCompanyCode, receiptDetail.getCompanyCode()); |
245 | 250 | ReceiptType receiptType = receiptTypeService.getOne(lambdaReceiptType); |
246 | 251 | |
247 | 252 | |
248 | - if (receiptType.getReceiptFlow() != null){ | |
253 | + if (receiptType.getReceiptFlow() != null) { | |
249 | 254 | //物料是否有入库流程 |
250 | 255 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptType.getReceiptFlow()); |
251 | 256 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
252 | 257 | //在状态到达时候是判断是否要质检 |
253 | - if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
258 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)) { | |
254 | 259 | receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); |
255 | 260 | } else { |
256 | 261 | receiptDetail.setProcessStamp(status); |
257 | 262 | } |
258 | 263 | return receiptDetail; |
259 | - } else if (material.getReceivingFlow() != null){ | |
264 | + } else if (material.getReceivingFlow() != null) { | |
260 | 265 | //物料是否有入库流程 |
261 | 266 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(material.getReceivingFlow()); |
262 | 267 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
263 | 268 | //在状态到达时候是判断是否要质检 |
264 | - if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
269 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)) { | |
265 | 270 | receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); |
266 | 271 | } else { |
267 | 272 | receiptDetail.setProcessStamp(status); |
... | ... | @@ -276,7 +281,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
276 | 281 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(materialType.getReceivingFlow()); |
277 | 282 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
278 | 283 | //在状态到达时候是判断是否要质检 |
279 | - if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
284 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)) { | |
280 | 285 | receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); |
281 | 286 | } else { |
282 | 287 | receiptDetail.setProcessStamp(status); |
... | ... | @@ -294,7 +299,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
294 | 299 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptPreference.getReceivingFlow()); |
295 | 300 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
296 | 301 | //在状态到达时候是判断是否要质检 |
297 | - if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
302 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)) { | |
298 | 303 | receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); |
299 | 304 | } else { |
300 | 305 | receiptDetail.setProcessStamp(status); |
... | ... | @@ -306,19 +311,20 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
306 | 311 | |
307 | 312 | /** |
308 | 313 | * 获取配置流程中下一状态 |
314 | + * | |
309 | 315 | * @param statusFlowDetails 流程列表 |
310 | - * @param status 当前状态 | |
316 | + * @param status 当前状态 | |
311 | 317 | */ |
312 | - public String nextStatusFlow(List<StatusFlowDetail> statusFlowDetails, String status){ | |
318 | + public String nextStatusFlow(List<StatusFlowDetail> statusFlowDetails, String status) { | |
313 | 319 | //判断当前状态是否为最后状态,若为最后状态返回当前状态 |
314 | - if (StringUtils.isEmpty(status)){ | |
320 | + if (StringUtils.isEmpty(status)) { | |
315 | 321 | status = "0"; |
316 | 322 | } |
317 | - if (statusFlowDetails.size() > 0 && status.equals(statusFlowDetails.get(statusFlowDetails.size()-1).getFlowCode())){ | |
323 | + if (statusFlowDetails.size() > 0 && status.equals(statusFlowDetails.get(statusFlowDetails.size() - 1).getFlowCode())) { | |
318 | 324 | return status; |
319 | 325 | } else { |
320 | - for (int i = 0; i < statusFlowDetails.size(); i++){ | |
321 | - if (Integer.parseInt(statusFlowDetails.get(i).getFlowCode()) > Integer.parseInt(status)){ | |
326 | + for (int i = 0; i < statusFlowDetails.size(); i++) { | |
327 | + if (Integer.parseInt(statusFlowDetails.get(i).getFlowCode()) > Integer.parseInt(status)) { | |
322 | 328 | return statusFlowDetails.get(i).getFlowCode(); |
323 | 329 | } |
324 | 330 | } |
... | ... | @@ -327,7 +333,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
327 | 333 | } |
328 | 334 | |
329 | 335 | @Override |
330 | - public List<StatusFlowDetail> queryflow(){ | |
336 | + public List<StatusFlowDetail> queryflow() { | |
331 | 337 | LambdaQueryWrapper<ConfigValue> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
332 | 338 | lambdaQueryWrapper.eq(ConfigValue::getModuleType, "receipt"); |
333 | 339 | ConfigValue configValue = configValueService.getOne(lambdaQueryWrapper); |
... | ... | @@ -340,13 +346,13 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
340 | 346 | } |
341 | 347 | |
342 | 348 | /** |
349 | + * @param id 头表id | |
343 | 350 | * @description 更新头表尾状态 |
344 | 351 | * 每次明细表更新后调用该方法 |
345 | 352 | * 当所有明细表到达该状态时,更新头表状态 |
346 | - * @param id 头表id | |
347 | 353 | */ |
348 | 354 | @Override |
349 | - public void updateReceiptHeaderLastStatus(Integer id){ | |
355 | + public void updateReceiptHeaderLastStatus(Integer id) { | |
350 | 356 | LambdaQueryWrapper<ReceiptDetail> lambdaDetails = Wrappers.lambdaQuery(); |
351 | 357 | lambdaDetails.eq(ReceiptDetail::getReceiptId, id); |
352 | 358 | List<ReceiptDetail> receiptDetails = this.list(lambdaDetails); |
... | ... | @@ -356,7 +362,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
356 | 362 | int minStatus; |
357 | 363 | int maxStatus; |
358 | 364 | // 判断入库明细是否为空, 为空时入库单头表状态为新建 |
359 | - if (receiptDetails.isEmpty()){ | |
365 | + if (receiptDetails.isEmpty()) { | |
360 | 366 | minStatus = 0; |
361 | 367 | maxStatus = 0; |
362 | 368 | } else { |
... | ... | @@ -365,11 +371,11 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
365 | 371 | |
366 | 372 | |
367 | 373 | //遍历明细状态得出最小状态值 |
368 | - for (int i = 1; i<receiptDetails.size(); i++){ | |
369 | - if ( minStatus > Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
374 | + for (int i = 1; i < receiptDetails.size(); i++) { | |
375 | + if (minStatus > Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
370 | 376 | minStatus = Integer.parseInt(receiptDetails.get(i).getProcessStamp()); |
371 | 377 | } |
372 | - if ( maxStatus < Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
378 | + if (maxStatus < Integer.parseInt(receiptDetails.get(i).getProcessStamp())) { | |
373 | 379 | maxStatus = Integer.parseInt(receiptDetails.get(i).getProcessStamp()); |
374 | 380 | } |
375 | 381 | } |
... | ... | @@ -387,6 +393,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
387 | 393 | |
388 | 394 | /** |
389 | 395 | * 入库单审核 |
396 | + * | |
390 | 397 | * @param ids |
391 | 398 | * @param approval |
392 | 399 | * @return |
... | ... | @@ -394,25 +401,25 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
394 | 401 | @Override |
395 | 402 | public AjaxResult approval(String ids, Integer approval) { |
396 | 403 | ReceiptHeader receiptHeader = new ReceiptHeader(); |
397 | - if (StringUtils.isEmpty(ids)){ | |
404 | + if (StringUtils.isEmpty(ids)) { | |
398 | 405 | return AjaxResult.error("id不能为空"); |
399 | 406 | } |
400 | 407 | Integer[] idArray = Convert.toIntArray(ids); |
401 | - for (Integer id: idArray) { | |
408 | + for (Integer id : idArray) { | |
402 | 409 | receiptHeader.setId(id); |
403 | 410 | receiptHeader.setLastStatus(approval); |
404 | 411 | receiptHeader.setFirstStatus(approval); |
405 | 412 | receiptHeader.setLastUpdatedBy(ShiroUtils.getName()); |
406 | - if (!receiptHeaderService.updateById(receiptHeader)){ | |
413 | + if (!receiptHeaderService.updateById(receiptHeader)) { | |
407 | 414 | throw new ServiceException("更新头表失败"); |
408 | 415 | } else { |
409 | 416 | LambdaQueryWrapper<ReceiptDetail> lambda = Wrappers.lambdaQuery(); |
410 | 417 | lambda.eq(ReceiptDetail::getReceiptId, id); |
411 | 418 | List<ReceiptDetail> receiptDetails = this.list(lambda); |
412 | - for (ReceiptDetail receiptDetail : receiptDetails){ | |
419 | + for (ReceiptDetail receiptDetail : receiptDetails) { | |
413 | 420 | receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_POOL.toString()); |
414 | 421 | receiptDetail = this.queryflow(receiptDetail); |
415 | - if (!this.updateById(receiptDetail)){ | |
422 | + if (!this.updateById(receiptDetail)) { | |
416 | 423 | throw new ServiceException("更新入库明细表失败"); |
417 | 424 | } |
418 | 425 | } |
... | ... | @@ -441,13 +448,13 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
441 | 448 | /** |
442 | 449 | * 判断明细中是否质检 |
443 | 450 | */ |
444 | - public boolean inspection(ReceiptDetail receiptDetail){ | |
451 | + public boolean inspection(ReceiptDetail receiptDetail) { | |
445 | 452 | //如果明细中需要质检,则判断是否已经生成质检单 |
446 | - if ("0".equals(receiptDetail.getQcCheck())){ | |
453 | + if ("0".equals(receiptDetail.getQcCheck())) { | |
447 | 454 | LambdaQueryWrapper<CheckHeader> lambda = Wrappers.lambdaQuery(); |
448 | 455 | lambda.eq(CheckHeader::getCode, receiptDetail.getReceiptCode()); |
449 | 456 | CheckHeader checkHeader = checkHeaderService.getOne(lambda); |
450 | - if (checkHeader == null){ | |
457 | + if (checkHeader == null) { | |
451 | 458 | return true; |
452 | 459 | } |
453 | 460 | } |
... | ... | @@ -455,11 +462,12 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
455 | 462 | } |
456 | 463 | |
457 | 464 | /** |
458 | - // * 移动端收货 | |
459 | - // * | |
460 | - // * @param code | |
461 | - // * @return | |
462 | - // */ | |
465 | + * // * 移动端收货 | |
466 | + * // * | |
467 | + * // * @param code | |
468 | + * // * @return | |
469 | + * // | |
470 | + */ | |
463 | 471 | @Override |
464 | 472 | public AjaxResult scanReceiptCode(String code, String type, String companyCode) { |
465 | 473 | LambdaQueryWrapper<ReceiptHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... | @@ -468,7 +476,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
468 | 476 | ReceiptHeader receiptHeader = receiptHeaderService.getOne(lambdaQueryWrapper); |
469 | 477 | if (receiptHeader == null) { |
470 | 478 | LambdaQueryWrapper<Company> companyLambdaQueryWrapper = Wrappers.lambdaQuery(); |
471 | - companyLambdaQueryWrapper.eq(Company::getCode,companyCode); | |
479 | + companyLambdaQueryWrapper.eq(Company::getCode, companyCode); | |
472 | 480 | Company company = companyService.getOne(companyLambdaQueryWrapper); |
473 | 481 | return AjaxResult.success(""); |
474 | 482 | // return receiptHeaderService.findErpReceipt(String.valueOf(company.getId()), receiptHeader.getReferType(), receiptHeader.getReferCode()); |
... | ... | @@ -486,18 +494,18 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
486 | 494 | List<Integer> mReceiptDetailIds = new ArrayList<>(); |
487 | 495 | ReceiptHeader receiptHeader = receiptHeaderService.getById(headerId); |
488 | 496 | |
489 | - for(ReceiptBill receiptBill : receiptBills) { | |
497 | + for (ReceiptBill receiptBill : receiptBills) { | |
490 | 498 | ReceiptDetail receiptDetail = new ReceiptDetail(); |
491 | 499 | receiptDetail.setId(null); |
492 | 500 | receiptDetail.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
493 | - receiptDetail.setCompanyCode(companyCode); | |
501 | + receiptDetail.setCompanyCode(companyCode); | |
494 | 502 | receiptDetail.setReceiptId(receiptHeader.getId()); |
495 | 503 | receiptDetail.setReceiptCode(receiptHeader.getCode()); |
496 | 504 | receiptDetail.setMaterialCode(receiptBill.getMaterialCode()); |
497 | 505 | receiptDetail.setMaterialName(receiptBill.getMaterialName()); |
498 | 506 | receiptDetail.setInventorySts("good"); |
499 | 507 | receiptDetail.setQty(receiptBill.getQty()); |
500 | - if(isCompletedQty) { | |
508 | + if (isCompletedQty) { | |
501 | 509 | receiptDetail.setTaskQty(receiptBill.getQty()); |
502 | 510 | } |
503 | 511 | receiptDetail.setCreatedBy(ShiroUtils.getName()); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java
... | ... | @@ -110,7 +110,7 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
110 | 110 | SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); |
111 | 111 | LambdaQueryWrapper<ReceiptHeader> lambda = Wrappers.lambdaQuery(); |
112 | 112 | lambda.select(ReceiptHeader::getCode).eq(ReceiptHeader::getReceiptType, receiptType) |
113 | - .inSql(ReceiptHeader::getCode, "select code from receipt_header where code like '"+receiptType+"%'") | |
113 | + .inSql(ReceiptHeader::getCode, "select code from receipt_header where code like '" + receiptType + "%'") | |
114 | 114 | .orderByDesc(ReceiptHeader::getId).last("Limit 1"); |
115 | 115 | //如果指定类型的最后的code存在,并且日期一致。那么 code = 入库单类型 + 年月日 + (排序号 + 1) |
116 | 116 | String maxCode = null; |
... | ... | @@ -127,12 +127,12 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
127 | 127 | Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); |
128 | 128 | code = receiptType + df.format(now) + String.format("%05d", Count + i++); |
129 | 129 | } else { |
130 | - code = receiptType + df.format(now) + String.format("%05d", 0000+i++); | |
130 | + code = receiptType + df.format(now) + String.format("%05d", 0000 + i++); | |
131 | 131 | } |
132 | 132 | aa.select(ReceiptHeaderHistory::getCode).eq(ReceiptHeaderHistory::getCode, code); |
133 | 133 | List<ReceiptHeaderHistory> list = receiptheaderhistoryMapper.selectList(aa); |
134 | 134 | if (list.size() <= 0) { |
135 | - i=0; | |
135 | + i = 0; | |
136 | 136 | } |
137 | 137 | } |
138 | 138 | return code; |
... | ... |
src/main/java/com/huaheng/pc/rgv/service/impl/RgvServiceImpl.java
... | ... | @@ -52,7 +52,7 @@ public class RgvServiceImpl implements RgvService { |
52 | 52 | String code = result1.getBody().getString("RequestStatus"); |
53 | 53 | String msg = result1.getBody().getString("Msg"); |
54 | 54 | if (!HttpConstant.isMesSuccess(Integer.parseInt(code))) { |
55 | - throw new ServiceException(msg); | |
55 | + throw new ServiceException("发送RGV点位报错:" + msg); | |
56 | 56 | } |
57 | 57 | |
58 | 58 | RgvTask rgvTask = new RgvTask(); |
... | ... |
src/main/resources/application-druid.properties
... | ... | @@ -5,13 +5,13 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver |
5 | 5 | #spring.datasource.druid.master.username=root |
6 | 6 | #spring.datasource.druid.master.password=HHsoft123. |
7 | 7 | # \u963F\u91CC\u4E91 |
8 | -spring.datasource.druid.master.url=jdbc:mysql://124.223.139.61:3366/wms_ningboyongqiang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8&autoReconnect=true&maxReconnects=9999&initialTimeout=30&rewriteBatchedStatements=true | |
9 | -spring.datasource.druid.master.username=root | |
10 | -spring.datasource.druid.master.password=qq123456 | |
11 | -# \u672C\u5730 | |
12 | -#spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms_ningboyongqiang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8&autoReconnect=true&maxReconnects=9999&initialTimeout=30&rewriteBatchedStatements=true | |
8 | +#spring.datasource.druid.master.url=jdbc:mysql://124.223.139.61:3366/wms_ningboyongqiang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8&autoReconnect=true&maxReconnects=9999&initialTimeout=30&rewriteBatchedStatements=true | |
13 | 9 | #spring.datasource.druid.master.username=root |
14 | -#spring.datasource.druid.master.password=123456 | |
10 | +#spring.datasource.druid.master.password=qq123456 | |
11 | +# \u672C\u5730 | |
12 | +spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms_ningboyongqiang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8&autoReconnect=true&maxReconnects=9999&initialTimeout=30&rewriteBatchedStatements=true | |
13 | +spring.datasource.druid.master.username=root | |
14 | +spring.datasource.druid.master.password=123456 | |
15 | 15 | #WCS\u5E93 |
16 | 16 | #spring.datasource.druid.wcs.url = jdbc:mysql://172.16.29.45:3306/huahengwcs3?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 |
17 | 17 | #spring.datasource.druid.wcs.username=softhuaheng |
... | ... |
src/main/resources/mybatis/monitor/JobLogMapper.xml
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | #{id} |
69 | 69 | </foreach> |
70 | 70 | </delete> |
71 | - | |
71 | + | |
72 | 72 | <insert id="insertJobLog" parameterType="com.huaheng.pc.monitor.job.domain.JobLog"> |
73 | 73 | insert into sys_job_log( |
74 | 74 | <if test="id != null and id != 0">id,</if> |
... | ... | @@ -93,10 +93,10 @@ |
93 | 93 | ) |
94 | 94 | </insert> |
95 | 95 | |
96 | - <update id="truncateTable"> | |
96 | + <delete id="truncateTable"> | |
97 | 97 | DELETE |
98 | 98 | FROM api_log |
99 | - WHERE apiName IN ('wcs任务完成', 'wcs调用wms分配库位', 'wcs到达拣选台', 'wms下发任务到wcs') | |
100 | - </update> | |
99 | + WHERE requestTime < DATE_SUB(CURDATE(), INTERVAL 15 DAY) | |
100 | + </delete> | |
101 | 101 | |
102 | 102 | </mapper> |
... | ... |