修复进货单空指针问题
continuous-integration/drone/push Build is passing Details

增加订阅审核节点
畅捷通同步方案更新
YXY 1 year ago
parent 8c7aca05fe
commit 090e89195b

@ -12,23 +12,32 @@ public enum CjtCallBackOperateEnum {
PURCHASE_ARRIVAL_ORDER_CREATE("PuArrival_Create", "新增进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()), PURCHASE_ARRIVAL_ORDER_CREATE("PuArrival_Create", "新增进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ARRIVAL_ORDER_UPDATE("PuArrival_Update", "修改进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()), PURCHASE_ARRIVAL_ORDER_UPDATE("PuArrival_Update", "修改进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ARRIVAL_ORDER_DELETE("PuArrival_Delete", "删除进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()), PURCHASE_ARRIVAL_ORDER_DELETE("PuArrival_Delete", "删除进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ARRIVAL_ORDER_AUDIT("PuArrival_Audit", "审核进货单",AppType.SYNC_CJT_PURCHASE_ARRIVAL_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ORDER_CREATE("PurchaseOrder_Create", "新增采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()), PURCHASE_ORDER_CREATE("PurchaseOrder_Create", "新增采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ORDER_UPDATE("PurchaseOrder_Update", "修改采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()), PURCHASE_ORDER_UPDATE("PurchaseOrder_Update", "修改采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ORDER_DELETE("PurchaseOrder_Delete", "删除采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()), PURCHASE_ORDER_DELETE("PurchaseOrder_Delete", "删除采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
PURCHASE_ORDER_AUDIT("PurchaseOrder_Audit", "审核采购订单",AppType.SYNC_CJT_PURCHASE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
SALE_DELIVERY_CREATE("SaleDelivery_Create", "新增销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()), SALE_DELIVERY_CREATE("SaleDelivery_Create", "新增销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()),
SALE_DELIVERY_UPDATE("SaleDelivery_Create", "修改销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()), SALE_DELIVERY_UPDATE("SaleDelivery_Create", "修改销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()),
SALE_DELIVERY_DELETE("SaleDelivery_Create", "删除销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()), SALE_DELIVERY_DELETE("SaleDelivery_Create", "删除销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()),
SALE_DELIVERY_AUDIT("SaleDelivery_Audit", "审核销货单",AppType.SYNC_CJT_SALE_DELIVERY_DATA_TO_MULTI_TABLE.getCode()),
SALE_DISPATCH_CREATE("SaleDispatchVoucher_Create", "新增销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()), SALE_DISPATCH_CREATE("SaleDispatchVoucher_Create", "新增销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()),
SALE_DISPATCH_UPDATE("SaleDispatchVoucher_Update", "修改销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()), SALE_DISPATCH_UPDATE("SaleDispatchVoucher_Update", "修改销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()),
SALE_DISPATCH_DELETE("SaleDispatchVoucher_Delete", "删除销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()), SALE_DISPATCH_DELETE("SaleDispatchVoucher_Delete", "删除销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()),
SALE_DISPATCH_AUDIT("SaleDispatchVoucher_Audit", "审核销售出库单",AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode()),
MANUFACTURE_ORDER_CREATE("ManufactureOrder_Create", "新增加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()), MANUFACTURE_ORDER_CREATE("ManufactureOrder_Create", "新增加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
MANUFACTURE_ORDER_UPDATE("ManufactureOrder_Update", "修改加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()), MANUFACTURE_ORDER_UPDATE("ManufactureOrder_Update", "修改加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
MANUFACTURE_ORDER_DELETE("ManufactureOrder_Delete", "删除加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()), MANUFACTURE_ORDER_DELETE("ManufactureOrder_Delete", "删除加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
MANUFACTURE_ORDER_AUDIT("ManufactureOrder_Audit", "审核加工单",AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
SALE_ORDER_CREATE("SaleOrder_Create", "新增销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode()), SALE_ORDER_CREATE("SaleOrder_Create", "新增销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
SALE_ORDER_UPDATE("SaleOrder_Update", "修改销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode()), SALE_ORDER_UPDATE("SaleOrder_Update", "修改销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
SALE_ORDER_DELETE("SaleOrder_Delete", "删除销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode()); SALE_ORDER_DELETE("SaleOrder_Delete", "删除销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode()),
SALE_ORDER_AUDIT("SaleOrder_Audit", "审核销售订单",AppType.SYNC_CJT_SALE_ORDER_DATA_TO_MULTI_TABLE.getCode());
private final String code; private final String code;

@ -66,18 +66,17 @@ public abstract class CJTOperateCallBackAbstract {
CjtCallBackOperateEnum msgTypeEnum = req.getMsgTypeEnum(); CjtCallBackOperateEnum msgTypeEnum = req.getMsgTypeEnum();
String operateCallBackFlag = buildCacheUniqueKey(RedisConstants.CJT_CALLBACK_OPERATE, req.getAppId() + msgTypeEnum.getLarkCompanyCode() + req.getVoucherId()); String operateCallBackFlag = buildCacheUniqueKey(RedisConstants.CJT_CALLBACK_OPERATE, req.getAppId() + msgTypeEnum.getLarkCompanyCode() + req.getVoucherId());
try { try {
Boolean operateFlag = redisCache.setCacheObjectIfAbsent(operateCallBackFlag, operateCallBackFlag, 2L, TimeUnit.MINUTES); preHandle(req);
Boolean operateFlag = redisCache.setCacheObjectIfAbsent(operateCallBackFlag, operateCallBackFlag, 5L, TimeUnit.MINUTES);
if (!operateFlag) { if (!operateFlag) {
return; return;
} }
preHandle(req);
initContext(req); initContext(req);
// resetTicket(req);
sync(req); sync(req);
endHandle(req); endHandle(req);
} catch (Exception e) { } catch (Exception e) {
log.error("{} execute error", this.getClass().getSimpleName(), e); log.error("{} execute error", this.getClass().getSimpleName(), e);
if (req.getRetry() && req.getRetryCount() < 2) { if (req.getRetry() && req.getRetryCount() < 1) {
req.addRetryCount(); req.addRetryCount();
execute(req); execute(req);
} else { } else {
@ -85,6 +84,7 @@ public abstract class CJTOperateCallBackAbstract {
larkRobotHelper.sendMessageByBot(ROBOT_GROUP, buildRobotErrorCountMessage(req, e)); larkRobotHelper.sendMessageByBot(ROBOT_GROUP, buildRobotErrorCountMessage(req, e));
} }
} }
redisCache.deleteObject(operateCallBackFlag);
} }
public void preHandle(CJTEdiCallbackRequestVo req) { public void preHandle(CJTEdiCallbackRequestVo req) {

@ -50,31 +50,37 @@ public class CJTOperateCallBackFactory {
case SALE_DISPATCH_CREATE: case SALE_DISPATCH_CREATE:
case SALE_DISPATCH_UPDATE: case SALE_DISPATCH_UPDATE:
case SALE_DISPATCH_DELETE: case SALE_DISPATCH_DELETE:
case SALE_DISPATCH_AUDIT:
saleDispatchSyncCallOperate.execute(cjtEdiCallbackRequestVo); saleDispatchSyncCallOperate.execute(cjtEdiCallbackRequestVo);
break; break;
case SALE_ORDER_CREATE: case SALE_ORDER_CREATE:
case SALE_ORDER_UPDATE: case SALE_ORDER_UPDATE:
case SALE_ORDER_DELETE: case SALE_ORDER_DELETE:
case SALE_ORDER_AUDIT:
saleOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo); saleOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
break; break;
case MANUFACTURE_ORDER_CREATE: case MANUFACTURE_ORDER_CREATE:
case MANUFACTURE_ORDER_UPDATE: case MANUFACTURE_ORDER_UPDATE:
case MANUFACTURE_ORDER_DELETE: case MANUFACTURE_ORDER_DELETE:
case MANUFACTURE_ORDER_AUDIT:
manufactureOrderSyncCallOperate.execute(cjtEdiCallbackRequestVo); manufactureOrderSyncCallOperate.execute(cjtEdiCallbackRequestVo);
break; break;
case PURCHASE_ORDER_CREATE: case PURCHASE_ORDER_CREATE:
case PURCHASE_ORDER_UPDATE: case PURCHASE_ORDER_UPDATE:
case PURCHASE_ORDER_DELETE: case PURCHASE_ORDER_DELETE:
case PURCHASE_ORDER_AUDIT:
purchaseOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo); purchaseOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
break; break;
case PURCHASE_ARRIVAL_ORDER_CREATE: case PURCHASE_ARRIVAL_ORDER_CREATE:
case PURCHASE_ARRIVAL_ORDER_UPDATE: case PURCHASE_ARRIVAL_ORDER_UPDATE:
case PURCHASE_ARRIVAL_ORDER_DELETE: case PURCHASE_ARRIVAL_ORDER_DELETE:
case PURCHASE_ARRIVAL_ORDER_AUDIT:
purchaseArrivalOrderCallBackOperate.execute(cjtEdiCallbackRequestVo); purchaseArrivalOrderCallBackOperate.execute(cjtEdiCallbackRequestVo);
break; break;
case SALE_DELIVERY_CREATE: case SALE_DELIVERY_CREATE:
case SALE_DELIVERY_UPDATE: case SALE_DELIVERY_UPDATE:
case SALE_DELIVERY_DELETE: case SALE_DELIVERY_DELETE:
case SALE_DELIVERY_AUDIT:
saleDeliverySyncCallBackOperate.execute(cjtEdiCallbackRequestVo); saleDeliverySyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
break; break;
default: default:

@ -27,6 +27,7 @@ public class ManufactureOrderSyncCallOperate extends CJTOperateCallBackAbstract
addRecord(req, returnBody); addRecord(req, returnBody);
break; break;
case MANUFACTURE_ORDER_UPDATE: case MANUFACTURE_ORDER_UPDATE:
case MANUFACTURE_ORDER_AUDIT:
updateRecord(req,returnBody); updateRecord(req,returnBody);
break; break;
case MANUFACTURE_ORDER_DELETE: case MANUFACTURE_ORDER_DELETE:

@ -26,6 +26,7 @@ public class PurchaseArrivalOrderCallBackOperate extends CJTOperateCallBackAbstr
addRecord(req, returnBody); addRecord(req, returnBody);
break; break;
case PURCHASE_ARRIVAL_ORDER_UPDATE: case PURCHASE_ARRIVAL_ORDER_UPDATE:
case PURCHASE_ARRIVAL_ORDER_AUDIT:
updateRecord(req,returnBody); updateRecord(req,returnBody);
break; break;
case PURCHASE_ARRIVAL_ORDER_DELETE: case PURCHASE_ARRIVAL_ORDER_DELETE:
@ -111,7 +112,7 @@ public class PurchaseArrivalOrderCallBackOperate extends CJTOperateCallBackAbstr
@Override @Override
protected String getDetailName() { protected String getDetailName() {
return "PurchaseOrderDetails"; return "Details";
} }
} }

@ -26,6 +26,7 @@ public class PurchaseOrderSyncCallBackOperate extends CJTOperateCallBackAbstract
addRecord(req, returnBody); addRecord(req, returnBody);
break; break;
case PURCHASE_ORDER_UPDATE: case PURCHASE_ORDER_UPDATE:
case PURCHASE_ORDER_AUDIT:
updateRecord(req,returnBody); updateRecord(req,returnBody);
break; break;
case PURCHASE_ORDER_DELETE: case PURCHASE_ORDER_DELETE:

@ -26,6 +26,7 @@ public class SaleDeliverySyncCallBackOperate extends CJTOperateCallBackAbstract
addRecord(req, returnBody); addRecord(req, returnBody);
break; break;
case SALE_DELIVERY_UPDATE: case SALE_DELIVERY_UPDATE:
case SALE_DELIVERY_AUDIT:
updateRecord(req,returnBody); updateRecord(req,returnBody);
break; break;
case SALE_DELIVERY_DELETE: case SALE_DELIVERY_DELETE:

@ -27,6 +27,7 @@ public class SaleDispatchSyncCallOperate extends CJTOperateCallBackAbstract {
addRecord(req, returnBody); addRecord(req, returnBody);
break; break;
case SALE_DISPATCH_UPDATE: case SALE_DISPATCH_UPDATE:
case SALE_DISPATCH_AUDIT:
updateRecord(req,returnBody); updateRecord(req,returnBody);
break; break;
case SALE_DISPATCH_DELETE: case SALE_DISPATCH_DELETE:

@ -26,6 +26,7 @@ public class SaleOrderSyncCallBackOperate extends CJTOperateCallBackAbstract{
addRecord(req, returnBody); addRecord(req, returnBody);
break; break;
case SALE_ORDER_UPDATE: case SALE_ORDER_UPDATE:
case SALE_ORDER_AUDIT:
updateRecord(req,returnBody); updateRecord(req,returnBody);
break; break;
case SALE_ORDER_DELETE: case SALE_ORDER_DELETE:

Loading…
Cancel
Save