推送逻辑修改;

This commit is contained in:
王奎兴
2026-06-12 17:16:09 +08:00
parent 2d241848dc
commit 2441f4eb1c
3 changed files with 49 additions and 36 deletions
@@ -284,17 +284,21 @@ public class ReservationStockInOrderApplicationService {
*/ */
public Boolean auditState(ReservationStockInOrderDO stockInOrderDO){ public Boolean auditState(ReservationStockInOrderDO stockInOrderDO){
Boolean b = stockInOrderDomainService.auditState(stockInOrderDO); Boolean b = stockInOrderDomainService.auditState(stockInOrderDO);
Integer needCustomsDeclaration = stockInOrderDO.getNeedCustomsDeclaration(); List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
Integer auditStatus = stockInOrderDO.getIssueStatus(); if (inOrderIds != null && !inOrderIds.isEmpty()) {
try { ReservationStockInOrder stockInOrder = reservationStockInOrderMapper.selectById(inOrderIds.get(0));
if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 2) { Integer needCustomsDeclaration = stockInOrder.getNeedCustomsDeclaration();
Long inOrderId = stockInOrderDO.getInOrderId(); Integer auditStatus = stockInOrder.getIssueStatus();
List<Long> idList = new ArrayList<>(); try {
idList.add(inOrderId); if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 2) {
batchPush(idList); Long inOrderId = stockInOrder.getInOrderId();
List<Long> idList = new ArrayList<>();
idList.add(inOrderId);
batchPush(idList);
}
} catch (Exception e) {
throw new ServiceException("推送关务系统失败!");
} }
} catch (Exception e) {
throw new ServiceException("推送关务系统失败!");
} }
return b; return b;
} }
@@ -495,18 +495,23 @@ public class StockInOrderApplicationService {
*/ */
public Boolean auditState(StockInOrderDO stockInOrderDO){ public Boolean auditState(StockInOrderDO stockInOrderDO){
Boolean b = stockInOrderDomainService.auditState(stockInOrderDO); Boolean b = stockInOrderDomainService.auditState(stockInOrderDO);
Integer needCustomsDeclaration = stockInOrderDO.getNeedCustomsDeclaration(); List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
Integer auditStatus = stockInOrderDO.getAuditStatus(); if (inOrderIds != null && !inOrderIds.isEmpty()) {
try { StockInOrder stockInOrder = stockInOrderService.getById(inOrderIds.get(0));
if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 3) { Integer needCustomsDeclaration = stockInOrder.getNeedCustomsDeclaration();
Long inOrderId = stockInOrderDO.getInOrderId(); Integer auditStatus = stockInOrder.getAuditStatus();
List<Long> idList = new ArrayList<>(); try {
idList.add(inOrderId); if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 3) {
batchPush(idList); Long inOrderId = stockInOrder.getInOrderId();
List<Long> idList = new ArrayList<>();
idList.add(inOrderId);
batchPush(idList);
}
} catch (Exception e) {
throw new ServiceException("推送关务系统失败!");
} }
} catch (Exception e) {
throw new ServiceException("推送关务系统失败!");
} }
return b; return b;
} }
@@ -1001,24 +1001,28 @@ public class StockOutOrderApplicationService {
*/ */
public Boolean genPickingOrder(StockOutOrderDO stockOutOrderDO){ public Boolean genPickingOrder(StockOutOrderDO stockOutOrderDO){
Boolean b = stockOutOrderDomainService.genPickingOrder(stockOutOrderDO); Boolean b = stockOutOrderDomainService.genPickingOrder(stockOutOrderDO);
String needDeclareFlag = stockOutOrderDO.getNeedDeclareFlag(); List<Long> outOrderIds = stockOutOrderDO.getOutOrderIds();
Long organizationId = stockOutOrderDO.getOrganizationId(); if (outOrderIds != null && !outOrderIds.isEmpty()) {
try { StockOutOrder order = stockOutOrderService.getById(outOrderIds.get(0));
if (needDeclareFlag != null && "1".equals(needDeclareFlag) && organizationId != null) { String needDeclareFlag = order.getNeedDeclareFlag();
if (organizationId == 2830) { Long organizationId = order.getOrganizationId();
Long outOrderId = stockOutOrderDO.getOutOrderId(); try {
List<Long> ids = new ArrayList<>(); if (needDeclareFlag != null && "1".equals(needDeclareFlag) && organizationId != null) {
ids.add(outOrderId); if (organizationId == 2830) {
batchPush(ids); Long outOrderId = order.getOutOrderId();
} else { List<Long> ids = new ArrayList<>();
String outOrderId = stockOutOrderDO.getOutOrderNumber(); ids.add(outOrderId);
List<String> ids = new ArrayList<>(); batchPush(ids);
ids.add(outOrderId); } else {
omsServiceFeign.batchPushByNumber(ids); String outOrderId = order.getOutOrderNumber();
List<String> ids = new ArrayList<>();
ids.add(outOrderId);
omsServiceFeign.batchPushByNumber(ids);
}
} }
} catch (Exception e) {
throw new ServiceException("生成报关单失败");
} }
} catch (Exception e) {
throw new ServiceException("生成报关单失败");
} }
return b; return b;
} }