Commit 93721ff414eafe230bd92d2b291564c5547ae23e
1 parent
75336c9a
如果回传失败,那么每隔很长一段时间继续回传
Showing
6 changed files
with
81 additions
and
11 deletions
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -175,8 +175,9 @@ |
175 | 175 | </template> |
176 | 176 | |
177 | 177 | <span slot="action" slot-scope="text, record"> |
178 | - <a-popconfirm v-has="'receiptHeader:back'" v-show="record.lastStatus == 800 && record.referCode != null" title="确定回传吗?" @confirm="() => hanleBack(record)"> | |
178 | + <a-popconfirm v-has="'receiptHeader:back'" v-show="(record.lastStatus == 800 || record.lastStatus == 850)&& record.referCode != null" title="确定回传吗?" @confirm="() => hanleBack(record)"> | |
179 | 179 | <a><a-button type="default">回传</a-button></a> |
180 | + <a-divider type="vertical"/> | |
180 | 181 | </a-popconfirm> |
181 | 182 | <a-popconfirm v-has="'receiptHeader:crossDocking'" v-show="record.lastStatus == 0" title="确定越库吗?" @confirm="() => hanleCross(record)"> |
182 | 183 | <a><a-button type="primary">越库</a-button></a> |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -214,9 +214,11 @@ |
214 | 214 | <span slot="action" slot-scope="text, record"> |
215 | 215 | <a v-if="record.firstStatus == '0' && flowOff == '1'" @click="createAudit(record)"><a-button type="primary">提交审核</a-button><a-divider type="vertical"/></a> |
216 | 216 | <a v-if="record.nextAuditor == username && flowOff == '1' " @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a> |
217 | - <a-popconfirm v-has="'shipmentHeader:back'" v-if="record.lastStatus == 800 && record.referCode != null" title="确定回传吗?" @confirm="() => hanleBack(record)"> | |
217 | + <a-popconfirm v-has="'shipmentHeader:back'" v-show="(record.lastStatus == 800 || record.lastStatus == 850)&& record.referCode != null" title="确定回传吗?" @confirm="() => hanleBack(record)"> | |
218 | 218 | <a><a-button type="default">回传</a-button></a> |
219 | + <a-divider type="vertical"/> | |
219 | 220 | </a-popconfirm> |
221 | + <a v-show="record.lastStatus == 850" @click="viewReason(record)"><a-button type="danger">原因</a-button><a-divider type="vertical"/></a> | |
220 | 222 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) |
221 | 223 | || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button><a-divider type="vertical"/></a> |
222 | 224 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) |
... | ... | @@ -274,6 +276,7 @@ import ShipmentAuditModal from "./modules/ShipmentAuditModal"; |
274 | 276 | import FlowProcess from "../flow/FlowProcess"; |
275 | 277 | import AutoShipmentSelectModal from "@views/system/shipment/modules/AutoShipmentSelectModal"; |
276 | 278 | import '@/assets/less/TableExpand.less' |
279 | +import {notification} from "ant-design-vue"; | |
277 | 280 | |
278 | 281 | export default { |
279 | 282 | name: "ShipmentHeaderList", |
... | ... | @@ -486,6 +489,12 @@ export default { |
486 | 489 | this.$message.error("至少选择两条符合条件的记录!") |
487 | 490 | } |
488 | 491 | }, |
492 | + viewReason(record){ | |
493 | + notification.open({ | |
494 | + message:"出库单号:"+record.code, | |
495 | + description:record.backErrorMsg | |
496 | + }) | |
497 | + }, | |
489 | 498 | getDocumentAduitFlowStaus(){ |
490 | 499 | getDocumentAduitFlow().then((res) => { |
491 | 500 | this.flowOff=res.message; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/ErpTask.java
... | ... | @@ -42,8 +42,7 @@ public class ErpTask implements Job { |
42 | 42 | @Override |
43 | 43 | public void execute(JobExecutionContext context) throws JobExecutionException { |
44 | 44 | LambdaQueryWrapper<ReceiptHeader> receiptHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
45 | - receiptHeaderLambdaQueryWrapper.in(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED, QuantityConstant.RECEIPT_HEADER_RETURN_ERROR) | |
46 | - .isNotNull(ReceiptHeader::getReferCode); | |
45 | + receiptHeaderLambdaQueryWrapper.eq(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED).isNotNull(ReceiptHeader::getReferCode); | |
47 | 46 | List<ReceiptHeader> receiptHeaderList = receiptHeaderService.list(receiptHeaderLambdaQueryWrapper); |
48 | 47 | for (ReceiptHeader receiptHeader : receiptHeaderList) { |
49 | 48 | try { |
... | ... | @@ -53,8 +52,7 @@ public class ErpTask implements Job { |
53 | 52 | } |
54 | 53 | } |
55 | 54 | LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
56 | - shipmentHeaderLambdaQueryWrapper.in(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED, QuantityConstant.SHIPMENT_HEADER_RETURN_ERROR) | |
57 | - .isNotNull(ShipmentHeader::getReferCode); | |
55 | + shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED).isNotNull(ShipmentHeader::getReferCode); | |
58 | 56 | List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper); |
59 | 57 | for (ShipmentHeader shipmentHeader : shipmentHeaderList) { |
60 | 58 | try { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/ErpTryTask.java
0 → 100644
1 | +package org.jeecg.modules.wms.monitor.job; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import javax.annotation.Resource; | |
6 | + | |
7 | +import org.jeecg.modules.wms.api.erp.service.IErpService; | |
8 | +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; | |
9 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
10 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; | |
11 | +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; | |
12 | +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; | |
13 | +import org.jeecg.utils.constant.QuantityConstant; | |
14 | +import org.quartz.*; | |
15 | + | |
16 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
17 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
18 | + | |
19 | +import lombok.extern.slf4j.Slf4j; | |
20 | + | |
21 | +/** | |
22 | + * @author 游杰 | |
23 | + */ | |
24 | +@Slf4j | |
25 | +@PersistJobDataAfterExecution | |
26 | +@DisallowConcurrentExecution | |
27 | +public class ErpTryTask implements Job { | |
28 | + | |
29 | + @Resource | |
30 | + private IReceiptHeaderService receiptHeaderService; | |
31 | + | |
32 | + @Resource | |
33 | + private IShipmentHeaderService shipmentHeaderService; | |
34 | + | |
35 | + @Resource | |
36 | + private IErpService erpService; | |
37 | + @Resource | |
38 | + private IHuahengMultiHandlerService huahengMultiHandlerService; | |
39 | + | |
40 | + @Override | |
41 | + public void execute(JobExecutionContext context) throws JobExecutionException { | |
42 | + LambdaQueryWrapper<ReceiptHeader> receiptHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
43 | + receiptHeaderLambdaQueryWrapper.eq(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_RETURN_ERROR).isNotNull(ReceiptHeader::getReferCode); | |
44 | + List<ReceiptHeader> receiptHeaderList = receiptHeaderService.list(receiptHeaderLambdaQueryWrapper); | |
45 | + for (ReceiptHeader receiptHeader : receiptHeaderList) { | |
46 | + try { | |
47 | + huahengMultiHandlerService.backReceipt(receiptHeader); | |
48 | + } catch (Exception e) { | |
49 | + e.printStackTrace(); | |
50 | + } | |
51 | + } | |
52 | + LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
53 | + shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_RETURN_ERROR).isNotNull(ShipmentHeader::getReferCode); | |
54 | + List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper); | |
55 | + for (ShipmentHeader shipmentHeader : shipmentHeaderList) { | |
56 | + try { | |
57 | + huahengMultiHandlerService.backShipment(shipmentHeader); | |
58 | + } catch (Exception e) { | |
59 | + e.printStackTrace(); | |
60 | + } | |
61 | + } | |
62 | + } | |
63 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... | ... | @@ -78,7 +78,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
78 | 78 | msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", recordReturnValue = true) |
79 | 79 | public boolean delMain(String id, String reason) { |
80 | 80 | ReceiptHeader receiptHeader = getById(id); |
81 | - if (receiptHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { | |
81 | + if (receiptHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD | |
82 | + && receiptHeader.getFirstStatus().intValue() <= QuantityConstant.RECEIPT_HEADER_COMPLETED) { | |
82 | 83 | throw new JeecgBootException("不能删除非新建状态单据"); |
83 | 84 | } |
84 | 85 | receiptHeaderHistoryService.saveById(id, reason); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -6,7 +6,6 @@ import java.text.SimpleDateFormat; |
6 | 6 | import java.util.Collection; |
7 | 7 | import java.util.Date; |
8 | 8 | import java.util.List; |
9 | -import java.util.Map; | |
10 | 9 | import java.util.stream.Collectors; |
11 | 10 | |
12 | 11 | import javax.annotation.Resource; |
... | ... | @@ -26,9 +25,7 @@ import org.jeecg.modules.wms.config.waveConfig.entity.WaveConfigDetail; |
26 | 25 | import org.jeecg.modules.wms.config.zone.entity.Zone; |
27 | 26 | import org.jeecg.modules.wms.config.zone.service.IZoneService; |
28 | 27 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
29 | -import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | |
30 | 28 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
31 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
32 | 29 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; |
33 | 30 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice; |
34 | 31 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; |
... | ... | @@ -127,7 +124,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
127 | 124 | @Transactional |
128 | 125 | public boolean delMain(String id, String reason) { |
129 | 126 | ShipmentHeader shipmentHeader = getById(id); |
130 | - if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { | |
127 | + if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.SHIPMENT_HEADER_BUILD | |
128 | + && shipmentHeader.getFirstStatus().intValue() <= QuantityConstant.SHIPMENT_HEADER_COMPLETED) { | |
131 | 129 | throw new JeecgBootException("不能删除非新建状态单据"); |
132 | 130 | } |
133 | 131 | shipmentHeaderHistoryService.saveById(id, reason); |
... | ... |