Commit 67ca6c762182f10256cc1dbdd4c8c934d6da6a77
1 parent
b305f573
edit
Showing
3 changed files
with
187 additions
and
99 deletions
src/main/java/com/huaheng/api/jindie/InvokeHelper.java
... | ... | @@ -19,11 +19,14 @@ import com.huaheng.common.exception.service.ServiceException; |
19 | 19 | import com.huaheng.common.support.Convert; |
20 | 20 | import com.huaheng.common.utils.DateUtils; |
21 | 21 | import com.huaheng.common.utils.StringUtils; |
22 | +import com.huaheng.framework.aspectj.ApiLogAspect; | |
22 | 23 | import com.huaheng.framework.aspectj.lang.annotation.ApiLogger; |
23 | 24 | import com.huaheng.pc.config.location.domain.Location; |
24 | 25 | import com.huaheng.pc.config.location.service.LocationService; |
25 | 26 | import com.huaheng.pc.config.supplier.domain.Supplier; |
26 | 27 | import com.huaheng.pc.config.supplier.service.SupplierService; |
28 | +import com.huaheng.pc.monitor.apilog.domain.ApiLog; | |
29 | +import com.huaheng.pc.monitor.apilog.service.IApiLogService; | |
27 | 30 | import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; |
28 | 31 | import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; |
29 | 32 | import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; |
... | ... | @@ -34,7 +37,9 @@ import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
34 | 37 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
35 | 38 | import com.huaheng.pc.system.config.service.IConfigService; |
36 | 39 | import org.springframework.beans.factory.annotation.Autowired; |
40 | +import org.springframework.scheduling.annotation.Async; | |
37 | 41 | import org.springframework.stereotype.Service; |
42 | +import org.springframework.transaction.annotation.Propagation; | |
38 | 43 | import org.springframework.transaction.annotation.Transactional; |
39 | 44 | import org.springframework.util.CollectionUtils; |
40 | 45 | |
... | ... | @@ -64,15 +69,22 @@ public class InvokeHelper { |
64 | 69 | private IConfigService configService; |
65 | 70 | @Autowired |
66 | 71 | private SupplierService supplierService; |
72 | + @Autowired | |
73 | + private IApiLogService apiLogService; | |
74 | + @Autowired | |
75 | + private ApiLogAspect apiLogAspect; | |
67 | 76 | |
68 | 77 | public static String POST_K3CloudURL = "http://219.137.250.36:8999/K3Cloud/"; |
69 | 78 | |
79 | + private ApiLog apiLog; | |
80 | + | |
70 | 81 | // Cookie 值 |
71 | 82 | // private static String CookieVal = null; |
72 | 83 | |
73 | 84 | // HttpURLConnection |
74 | - public HttpURLConnection initUrlConn(String url, JSONObject paras) | |
85 | + public synchronized HttpURLConnection initUrlConn(String url, JSONObject paras) | |
75 | 86 | throws Exception { |
87 | + | |
76 | 88 | System.out.println(paras.toString()); |
77 | 89 | URL postUrl = new URL(POST_K3CloudURL.concat(url)); |
78 | 90 | HttpURLConnection connection = (HttpURLConnection) postUrl |
... | ... | @@ -90,6 +102,7 @@ public class InvokeHelper { |
90 | 102 | out.writeBytes(paras.toString()); |
91 | 103 | out.flush(); |
92 | 104 | out.close(); |
105 | + apiLog = ApiLogAspect.initApiLog(connection, paras.toString(), "CS0001"); | |
93 | 106 | return connection; |
94 | 107 | } |
95 | 108 | |
... | ... | @@ -99,7 +112,6 @@ public class InvokeHelper { |
99 | 112 | */ |
100 | 113 | |
101 | 114 | // 收料通知单下推采购入库单 |
102 | - @Transactional(rollbackFor = Exception.class) | |
103 | 115 | public void push(String billCode) throws Exception { |
104 | 116 | PurchasePush purchasePush=new PurchasePush(); |
105 | 117 | PurchasePushData purchasePushData=new PurchasePushData(); |
... | ... | @@ -112,16 +124,51 @@ public class InvokeHelper { |
112 | 124 | purchasePush.setData(purchasePushData); |
113 | 125 | purchasePush.setFormid("PUR_ReceiveBill"); |
114 | 126 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
115 | - Results.ResultDTO.ResponseStatusDTO.SuccessEntitys successEntity = Invoke(JinDieApiUri.PURCHASE_PUSH.getApiUri(), jsonObject); | |
116 | - Integer id = successEntity.getId(); | |
117 | - String number = successEntity.getNumber(); | |
118 | - Integer dIndex = successEntity.getDIndex(); | |
127 | + Results.ResultDTO.ResponseStatusDTO responseStatusDTO = Invoke(JinDieApiUri.PURCHASE_PUSH.getApiUri(), jsonObject); | |
128 | + receiptResultHandle(responseStatusDTO,billCode,"push"); | |
129 | + } | |
130 | + | |
131 | + @Transactional(rollbackFor = Exception.class) | |
132 | + public void receiptResultHandle(Results.ResultDTO.ResponseStatusDTO responseStatusDTO,String billCode,String flag){ | |
133 | + List<Results.ResultDTO.ResponseStatusDTO.SuccessEntitys> successEntitys = responseStatusDTO.getSuccessEntitys(); | |
134 | + List<Results.ResultDTO.ResponseStatusDTO.ErrorsDTO> errors = responseStatusDTO.getErrors(); | |
135 | + Results.ResultDTO.ResponseStatusDTO.SuccessEntitys successEntity=null; | |
136 | + Results.ResultDTO.ResponseStatusDTO.ErrorsDTO errorsDTO=null; | |
119 | 137 | ReceiptHeader receiptHeader = receiptHeaderService.getOne(new LambdaQueryWrapper<ReceiptHeader>().eq(ReceiptHeader::getReferCode, billCode)); |
120 | - receiptHeader.setUserDef1(id.toString()); | |
121 | - receiptHeader.setUserDef2(number); | |
122 | - receiptHeaderService.updateById(receiptHeader); | |
138 | + if(!CollectionUtils.isEmpty(successEntitys)){ | |
139 | + successEntity = successEntitys.get(0); | |
140 | + if(flag.equals("push")){ | |
141 | + Integer id = successEntity.getId(); | |
142 | + String number = successEntity.getNumber(); | |
143 | + Integer dIndex = successEntity.getDIndex(); | |
144 | + receiptHeader.setUserDef1(id.toString()); | |
145 | + receiptHeader.setUserDef2(number); | |
146 | + receiptHeader.setUserDef3("成功"); | |
147 | + }else if(flag.equals("save")){ | |
148 | + receiptHeader.setUserDef4("成功"); | |
149 | + }else if(flag.equals("submit")){ | |
150 | + receiptHeader.setUserDef5("成功"); | |
151 | + }else if(flag.equals("audit")){ | |
152 | + receiptHeader.setUserDef6("成功"); | |
153 | + } | |
154 | + receiptHeaderService.updateById(receiptHeader); | |
155 | + }else { | |
156 | + errorsDTO = errors.get(0); | |
157 | + String message = errorsDTO.getMessage(); | |
158 | + if(flag.equals("push")){ | |
159 | + receiptHeader.setUserDef3(message); | |
160 | + }else if(flag.equals("save")){ | |
161 | + receiptHeader.setUserDef4(message); | |
162 | + }else if(flag.equals("submit")){ | |
163 | + receiptHeader.setUserDef5(message); | |
164 | + }else if(flag.equals("audit")){ | |
165 | + receiptHeader.setUserDef6(message); | |
166 | + } | |
167 | + receiptHeaderService.updateById(receiptHeader); | |
168 | + } | |
123 | 169 | } |
124 | 170 | |
171 | + | |
125 | 172 | // 采购入库单查询 |
126 | 173 | @Transactional(rollbackFor = Exception.class) |
127 | 174 | public void select(String billCode) throws Exception { |
... | ... | @@ -161,7 +208,8 @@ public class InvokeHelper { |
161 | 208 | } |
162 | 209 | }); |
163 | 210 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchaseBatchSave); |
164 | - Invoke(JinDieApiUri.PURCHASE_SAVE.getApiUri(), jsonObject); | |
211 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.PURCHASE_SAVE.getApiUri(), jsonObject); | |
212 | + receiptResultHandle(invoke,billCode,"save"); | |
165 | 213 | System.out.println("Save:"+"单号"+billCode+"成功!"); |
166 | 214 | } |
167 | 215 | |
... | ... | @@ -174,7 +222,8 @@ public class InvokeHelper { |
174 | 222 | purchasePush.setData(purchasePushData); |
175 | 223 | purchasePush.getData().setIds(receiptHeader.getUserDef1()); |
176 | 224 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
177 | - Invoke(JinDieApiUri.PURCHASE_SUBMIT.getApiUri(), jsonObject); | |
225 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.PURCHASE_SUBMIT.getApiUri(), jsonObject); | |
226 | + receiptResultHandle(invoke,billCode,"submit"); | |
178 | 227 | System.out.println("Submit:"+"单号"+billCode+"成功!"); |
179 | 228 | } |
180 | 229 | |
... | ... | @@ -187,7 +236,8 @@ public class InvokeHelper { |
187 | 236 | purchasePush.setData(purchasePushData); |
188 | 237 | purchasePush.getData().setIds(receiptHeader.getUserDef1()); |
189 | 238 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
190 | - Invoke(JinDieApiUri.PURCHASE_AUDIT.getApiUri(), jsonObject); | |
239 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.PURCHASE_AUDIT.getApiUri(), jsonObject); | |
240 | + receiptResultHandle(invoke,billCode,"audit"); | |
191 | 241 | System.out.println("Audit:"+"单号"+billCode+"成功!"); |
192 | 242 | } |
193 | 243 | |
... | ... | @@ -217,7 +267,6 @@ public class InvokeHelper { |
217 | 267 | * @param FDestStockId 调入仓库编码 |
218 | 268 | * @throws Exception |
219 | 269 | */ |
220 | - @Transactional(rollbackFor = Exception.class) | |
221 | 270 | public void allocateSave(String referCode,String FSrcStockId,String FDestStockId) throws Exception { |
222 | 271 | ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(new LambdaQueryWrapper<ShipmentHeader>().eq(ShipmentHeader::getReferCode, referCode)); |
223 | 272 | List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getReferCode, referCode)); |
... | ... | @@ -253,15 +302,46 @@ public class InvokeHelper { |
253 | 302 | allocate.getData().getModel().setFBillEntry(fBillEntryDTOS); |
254 | 303 | })); |
255 | 304 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(allocate); |
256 | - Results.ResultDTO.ResponseStatusDTO.SuccessEntitys invoke = Invoke(JinDieApiUri.ALLOCATE_SAVE.getApiUri(), jsonObject); | |
257 | - Integer id = invoke.getId(); | |
258 | - String number = invoke.getNumber(); | |
259 | - shipmentHeader.setUserDef1(id.toString()); | |
260 | - shipmentHeader.setUserDef2(number); | |
261 | - shipmentHeaderService.updateById(shipmentHeader); | |
305 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.ALLOCATE_SAVE.getApiUri(), jsonObject); | |
306 | + shipmentResultHandle(invoke,referCode,"save"); | |
262 | 307 | System.out.println("allocateSave:"+"单号"+referCode+"成功!"); |
263 | 308 | } |
264 | 309 | |
310 | + @Transactional(rollbackFor = Exception.class) | |
311 | + public void shipmentResultHandle(Results.ResultDTO.ResponseStatusDTO responseStatusDTO,String billCode,String flag){ | |
312 | + List<Results.ResultDTO.ResponseStatusDTO.SuccessEntitys> successEntitys = responseStatusDTO.getSuccessEntitys(); | |
313 | + List<Results.ResultDTO.ResponseStatusDTO.ErrorsDTO> errors = responseStatusDTO.getErrors(); | |
314 | + Results.ResultDTO.ResponseStatusDTO.SuccessEntitys successEntity=null; | |
315 | + Results.ResultDTO.ResponseStatusDTO.ErrorsDTO errorsDTO=null; | |
316 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(new LambdaQueryWrapper<ShipmentHeader>().eq(ShipmentHeader::getReferCode, billCode)); | |
317 | + if(!CollectionUtils.isEmpty(successEntitys)){ | |
318 | + successEntity = successEntitys.get(0); | |
319 | + if(flag.equals("save")){ | |
320 | + Integer id = successEntity.getId(); | |
321 | + String number = successEntity.getNumber(); | |
322 | + shipmentHeader.setUserDef1(id.toString()); | |
323 | + shipmentHeader.setUserDef2(number); | |
324 | + shipmentHeader.setUserDef4("成功"); | |
325 | + }else if(flag.equals("submit")){ | |
326 | + shipmentHeader.setUserDef5("成功"); | |
327 | + }else if(flag.equals("audit")){ | |
328 | + shipmentHeader.setUserDef6("成功"); | |
329 | + } | |
330 | + shipmentHeaderService.updateById(shipmentHeader); | |
331 | + }else { | |
332 | + errorsDTO = errors.get(0); | |
333 | + String message = errorsDTO.getMessage(); | |
334 | + if(flag.equals("save")){ | |
335 | + shipmentHeader.setUserDef4(message); | |
336 | + }else if(flag.equals("submit")){ | |
337 | + shipmentHeader.setUserDef5(message); | |
338 | + }else if(flag.equals("audit")){ | |
339 | + shipmentHeader.setUserDef6(message); | |
340 | + } | |
341 | + shipmentHeaderService.updateById(shipmentHeader); | |
342 | + } | |
343 | + } | |
344 | + | |
265 | 345 | //直接调拨单提交 |
266 | 346 | public void allocateSubmit(String referCode) throws Exception { |
267 | 347 | ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(new LambdaQueryWrapper<ShipmentHeader>().eq(ShipmentHeader::getReferCode, referCode)); |
... | ... | @@ -271,7 +351,8 @@ public class InvokeHelper { |
271 | 351 | purchasePush.setData(purchasePushData); |
272 | 352 | purchasePush.getData().setIds(shipmentHeader.getUserDef1()); |
273 | 353 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
274 | - Invoke(JinDieApiUri.ALLOCATE_SUBMIT.getApiUri(), jsonObject); | |
354 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.ALLOCATE_SUBMIT.getApiUri(), jsonObject); | |
355 | + shipmentResultHandle(invoke,referCode,"submit"); | |
275 | 356 | System.out.println("allocateSubmit:"+"单号"+referCode+"成功!"); |
276 | 357 | } |
277 | 358 | |
... | ... | @@ -284,7 +365,8 @@ public class InvokeHelper { |
284 | 365 | purchasePush.setData(purchasePushData); |
285 | 366 | purchasePush.getData().setIds(shipmentHeader.getUserDef1()); |
286 | 367 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
287 | - Invoke(JinDieApiUri.ALLOCATE_AUDIT.getApiUri(), jsonObject); | |
368 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.ALLOCATE_AUDIT.getApiUri(), jsonObject); | |
369 | + shipmentResultHandle(invoke,referCode,"audit"); | |
288 | 370 | System.out.println("allocateAudit:"+"单号"+referCode+"成功!"); |
289 | 371 | } |
290 | 372 | |
... | ... | @@ -294,7 +376,6 @@ public class InvokeHelper { |
294 | 376 | */ |
295 | 377 | |
296 | 378 | //采购退货单保存 |
297 | - @Transactional(rollbackFor = Exception.class) | |
298 | 379 | public void purchase_return_save(String referCode) throws Exception { |
299 | 380 | ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(new LambdaQueryWrapper<ShipmentHeader>().eq(ShipmentHeader::getReferCode, referCode)); |
300 | 381 | List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getReferCode, referCode)); |
... | ... | @@ -319,12 +400,8 @@ public class InvokeHelper { |
319 | 400 | // } |
320 | 401 | }); |
321 | 402 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchaseReturnSave); |
322 | - Results.ResultDTO.ResponseStatusDTO.SuccessEntitys successEntity = Invoke(JinDieApiUri.PURCHASE_RETURN_SAVE.getApiUri(), jsonObject); | |
323 | - Integer id = successEntity.getId(); | |
324 | - String number = successEntity.getNumber(); | |
325 | - shipmentHeader.setUserDef1(id.toString()); | |
326 | - shipmentHeader.setUserDef2(number); | |
327 | - shipmentHeaderService.updateById(shipmentHeader); | |
403 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.PURCHASE_RETURN_SAVE.getApiUri(), jsonObject); | |
404 | + shipmentResultHandle(invoke,referCode,"save"); | |
328 | 405 | System.out.println("PURCHASE_RETURN_SAVE:"+"单号"+referCode+"成功!"); |
329 | 406 | } |
330 | 407 | |
... | ... | @@ -337,7 +414,8 @@ public class InvokeHelper { |
337 | 414 | purchasePush.setData(purchasePushData); |
338 | 415 | purchasePush.getData().setIds(shipmentHeader.getReferLineId().toString()); |
339 | 416 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
340 | - Invoke(JinDieApiUri.PURCHASE_RETURN_SUBMIT.getApiUri(), jsonObject); | |
417 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.PURCHASE_RETURN_SUBMIT.getApiUri(), jsonObject); | |
418 | + shipmentResultHandle(invoke,referCode,"submit"); | |
341 | 419 | System.out.println("PURCHASE_RETURN_SUBMIT:"+"单号"+referCode+"成功!"); |
342 | 420 | } |
343 | 421 | |
... | ... | @@ -350,7 +428,8 @@ public class InvokeHelper { |
350 | 428 | purchasePush.setData(purchasePushData); |
351 | 429 | purchasePush.getData().setIds(shipmentHeader.getReferLineId().toString()); |
352 | 430 | JSONObject jsonObject = (JSONObject) JSONObject.toJSON(purchasePush); |
353 | - Invoke(JinDieApiUri.PURCHASE_RETURN_AUDIT.getApiUri(), jsonObject); | |
431 | + Results.ResultDTO.ResponseStatusDTO invoke = Invoke(JinDieApiUri.PURCHASE_RETURN_AUDIT.getApiUri(), jsonObject); | |
432 | + shipmentResultHandle(invoke,referCode,"audit"); | |
354 | 433 | System.out.println("PURCHASE_RETURN_AUDIT:"+"单号"+referCode+"成功!"); |
355 | 434 | } |
356 | 435 | |
... | ... | @@ -400,7 +479,7 @@ public class InvokeHelper { |
400 | 479 | * @return Results.ResultDTO.ResponseStatusDTO.SuccessEntitys |
401 | 480 | * @throws Exception |
402 | 481 | */ |
403 | - public Results.ResultDTO.ResponseStatusDTO.SuccessEntitys Invoke(String uri,JSONObject jParas) | |
482 | + public Results.ResultDTO.ResponseStatusDTO Invoke(String uri,JSONObject jParas) | |
404 | 483 | throws Exception { |
405 | 484 | HttpURLConnection connectionInvoke = initUrlConn(uri, jParas); |
406 | 485 | BufferedReader reader = new BufferedReader(new InputStreamReader(connectionInvoke.getInputStream())); |
... | ... | @@ -410,24 +489,25 @@ public class InvokeHelper { |
410 | 489 | sResult = new String(line.getBytes(), "utf-8"); |
411 | 490 | System.out.println(sResult); |
412 | 491 | } |
492 | + ApiLogAspect.finishApiLog(apiLog,connectionInvoke,sResult); | |
413 | 493 | Results results = JSONObject.parseObject(sResult, Results.class); |
414 | - List<Results.ResultDTO.ResponseStatusDTO.SuccessEntitys> successEntitys = results.getResult().getResponseStatus().getSuccessEntitys(); | |
415 | - List<Results.ResultDTO.ResponseStatusDTO.ErrorsDTO> errors = results.getResult().getResponseStatus().getErrors(); | |
416 | - Results.ResultDTO.ResponseStatusDTO.SuccessEntitys successEntity=null; | |
417 | - Results.ResultDTO.ResponseStatusDTO.ErrorsDTO errorsDTO=null; | |
418 | - if(!CollectionUtils.isEmpty(successEntitys)){ | |
419 | - successEntity = successEntitys.get(0); | |
420 | - }else { | |
421 | - errorsDTO = errors.get(0); | |
422 | - } | |
494 | +// List<Results.ResultDTO.ResponseStatusDTO.SuccessEntitys> successEntitys = results.getResult().getResponseStatus().getSuccessEntitys(); | |
495 | +// List<Results.ResultDTO.ResponseStatusDTO.ErrorsDTO> errors = results.getResult().getResponseStatus().getErrors(); | |
496 | +// Results.ResultDTO.ResponseStatusDTO.SuccessEntitys successEntity=null; | |
497 | +// Results.ResultDTO.ResponseStatusDTO.ErrorsDTO errorsDTO=null; | |
498 | +// if(!CollectionUtils.isEmpty(successEntitys)){ | |
499 | +// successEntity = successEntitys.get(0); | |
500 | +// }else { | |
501 | +// errorsDTO = errors.get(0); | |
502 | +// } | |
423 | 503 | reader.close(); |
424 | 504 | connectionInvoke.disconnect(); |
425 | - if(StringUtils.isNotNull(successEntity)){ | |
426 | - return successEntity; | |
427 | - }else { | |
428 | - throw new ServiceException(errorsDTO.getMessage()); | |
429 | - } | |
430 | - | |
505 | +// if(StringUtils.isNotNull(successEntity)){ | |
506 | +// return successEntity; | |
507 | +// }else { | |
508 | +// throw new ServiceException(errorsDTO.getMessage()); | |
509 | +// } | |
510 | + return results.getResult().getResponseStatus(); | |
431 | 511 | } |
432 | 512 | |
433 | 513 | /** |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -394,15 +394,19 @@ public class RyTask extends BaseController { |
394 | 394 | invokeHelper.select(referCode); |
395 | 395 | }else { |
396 | 396 | invokeHelper.save(referCode); |
397 | - invokeHelper.submit(referCode); | |
398 | - invokeHelper.audit(referCode); | |
399 | - receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
400 | - receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
401 | - receiptHeaderService.updateById(receiptHeader); | |
402 | - receiptDetails.forEach(receiptDetail -> { | |
403 | - receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_RETURN.toString()); | |
404 | - receiptDetailService.updateById(receiptDetail); | |
405 | - }); | |
397 | + if(receiptHeader.getUserDef4().equals("成功")){ | |
398 | + invokeHelper.submit(referCode); | |
399 | + } | |
400 | + if(receiptHeader.getUserDef5().equals("成功")){ | |
401 | + invokeHelper.audit(referCode); | |
402 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
403 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
404 | + receiptHeaderService.updateById(receiptHeader); | |
405 | + receiptDetails.forEach(receiptDetail -> { | |
406 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_RETURN.toString()); | |
407 | + receiptDetailService.updateById(receiptDetail); | |
408 | + }); | |
409 | + } | |
406 | 410 | } |
407 | 411 | } |
408 | 412 | } |
... | ... | @@ -430,16 +434,20 @@ public class RyTask extends BaseController { |
430 | 434 | invokeHelper.allocateSave(referCode,shipmentHeader.getFSrcStockId(),shipmentHeader.getFDestStockId()); |
431 | 435 | } |
432 | 436 | }else { |
433 | - invokeHelper.allocateSubmit(referCode); | |
434 | - invokeHelper.allocateAudit(referCode); | |
435 | - shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); | |
436 | - shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); | |
437 | - shipmentHeaderService.updateById(shipmentHeader); | |
438 | - List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId())); | |
439 | - shipmentDetails.forEach(shipmentDetail -> { | |
440 | - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); | |
441 | - shipmentDetailService.updateById(shipmentDetail); | |
442 | - }); | |
437 | + if(shipmentHeader.getUserDef4().equals("成功")){ | |
438 | + invokeHelper.allocateSubmit(referCode); | |
439 | + } | |
440 | + if(shipmentHeader.getUserDef5().equals("成功")){ | |
441 | + invokeHelper.allocateAudit(referCode); | |
442 | + shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); | |
443 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); | |
444 | + shipmentHeaderService.updateById(shipmentHeader); | |
445 | + List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId())); | |
446 | + shipmentDetails.forEach(shipmentDetail -> { | |
447 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_RETURN); | |
448 | + shipmentDetailService.updateById(shipmentDetail); | |
449 | + }); | |
450 | + } | |
443 | 451 | } |
444 | 452 | } |
445 | 453 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/domain/ShipmentHeader.java
... | ... | @@ -399,40 +399,40 @@ public class ShipmentHeader implements Serializable { |
399 | 399 | @ApiModelProperty(value = "自定义字段3") |
400 | 400 | private String userDef3; |
401 | 401 | |
402 | -// /** | |
403 | -// * 自定义字段4 | |
404 | -// */ | |
405 | -// @TableField(value = "userDef4") | |
406 | -// @ApiModelProperty(value = "自定义字段4") | |
407 | -// private String userDef4; | |
408 | -// | |
409 | -// /** | |
410 | -// * 自定义字段5 | |
411 | -// */ | |
412 | -// @TableField(value = "userDef5") | |
413 | -// @ApiModelProperty(value = "自定义字段5") | |
414 | -// private String userDef5; | |
415 | -// | |
416 | -// /** | |
417 | -// * 自定义字段6 | |
418 | -// */ | |
419 | -// @TableField(value = "userDef6") | |
420 | -// @ApiModelProperty(value = "自定义字段6") | |
421 | -// private String userDef6; | |
422 | -// | |
423 | -// /** | |
424 | -// * 自定义字段7 | |
425 | -// */ | |
426 | -// @TableField(value = "userDef7") | |
427 | -// @ApiModelProperty(value = "自定义字段7") | |
428 | -// private String userDef7; | |
429 | -// | |
430 | -// /** | |
431 | -// * 自定义字段8 | |
432 | -// */ | |
433 | -// @TableField(value = "userDef8") | |
434 | -// @ApiModelProperty(value = "自定义字段8") | |
435 | -// private String userDef8; | |
402 | + /** | |
403 | + * 自定义字段4 | |
404 | + */ | |
405 | + @TableField(value = "userDef4") | |
406 | + @ApiModelProperty(value = "自定义字段4") | |
407 | + private String userDef4; | |
408 | + | |
409 | + /** | |
410 | + * 自定义字段5 | |
411 | + */ | |
412 | + @TableField(value = "userDef5") | |
413 | + @ApiModelProperty(value = "自定义字段5") | |
414 | + private String userDef5; | |
415 | + | |
416 | + /** | |
417 | + * 自定义字段6 | |
418 | + */ | |
419 | + @TableField(value = "userDef6") | |
420 | + @ApiModelProperty(value = "自定义字段6") | |
421 | + private String userDef6; | |
422 | + | |
423 | + /** | |
424 | + * 自定义字段7 | |
425 | + */ | |
426 | + @TableField(value = "userDef7") | |
427 | + @ApiModelProperty(value = "自定义字段7") | |
428 | + private String userDef7; | |
429 | + | |
430 | + /** | |
431 | + * 自定义字段8 | |
432 | + */ | |
433 | + @TableField(value = "userDef8") | |
434 | + @ApiModelProperty(value = "自定义字段8") | |
435 | + private String userDef8; | |
436 | 436 | |
437 | 437 | /** |
438 | 438 | * 处理标记 |
... | ... |