开放所有回调接口
continuous-integration/drone/push Build is passing Details

畅捷通同步方案更新
YXY 1 year ago
parent 092149f70c
commit b4f25d47ac

@ -6,6 +6,7 @@ import com.lark.oapi.service.bitable.v1.model.CreateAppTableRecordRespBody;
import com.ruoyi.common.constant.RedisConstants; import com.ruoyi.common.constant.RedisConstants;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.CjtAccountEnum; import com.ruoyi.common.enums.CjtAccountEnum;
import com.ruoyi.common.enums.CjtCallBackOperateEnum;
import com.ruoyi.common.enums.FlagStatus; import com.ruoyi.common.enums.FlagStatus;
import com.ruoyi.flyingbook.LarkHelper.LarkRobotHelper; import com.ruoyi.flyingbook.LarkHelper.LarkRobotHelper;
import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper; import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper;
@ -62,7 +63,8 @@ public abstract class CJTOperateCallBackAbstract {
protected static final String REQUEST_ROOT_PATH = "https://openapi.chanjet.com"; protected static final String REQUEST_ROOT_PATH = "https://openapi.chanjet.com";
public void execute(CJTEdiCallbackRequestVo req) { public void execute(CJTEdiCallbackRequestVo req) {
String operateCallBackFlag = buildCacheUniqueKey(RedisConstants.CJT_CALLBACK_OPERATE, req.getAppId() + req.getVoucherId()); CjtCallBackOperateEnum msgTypeEnum = req.getMsgTypeEnum();
String operateCallBackFlag = buildCacheUniqueKey(RedisConstants.CJT_CALLBACK_OPERATE, req.getAppId() + msgTypeEnum.getLarkCompanyCode() + req.getVoucherId());
try { try {
Boolean operateFlag = redisCache.setCacheObjectIfAbsent(operateCallBackFlag, operateCallBackFlag, 10L, TimeUnit.MINUTES); Boolean operateFlag = redisCache.setCacheObjectIfAbsent(operateCallBackFlag, operateCallBackFlag, 10L, TimeUnit.MINUTES);
if (!operateFlag) { if (!operateFlag) {

@ -21,6 +21,12 @@ public class CJTOperateCallBackFactory {
private SaleDispatchSyncCallOperate saleDispatchSyncCallOperate; private SaleDispatchSyncCallOperate saleDispatchSyncCallOperate;
@Autowired @Autowired
private SaleOrderSyncCallBackOperate saleOrderSyncCallBackOperate; private SaleOrderSyncCallBackOperate saleOrderSyncCallBackOperate;
@Autowired
private PurchaseArrivalOrderCallBackOperate purchaseArrivalOrderCallBackOperate;
@Autowired
private PurchaseOrderSyncCallBackOperate purchaseOrderSyncCallBackOperate;
@Autowired
private SaleDeliverySyncCallBackOperate saleDeliverySyncCallBackOperate;
public void handle(JSONObject jsonObject){ public void handle(JSONObject jsonObject){
String appKey = jsonObject.getString("appKey"); String appKey = jsonObject.getString("appKey");
@ -44,36 +50,32 @@ 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:
switch (cjtAccountEnum){ saleDispatchSyncCallOperate.execute(cjtEdiCallbackRequestVo);
case ONE:
saleDispatchSyncCallOperate.execute(cjtEdiCallbackRequestVo);
break;
default:
break;
}
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:
switch (cjtAccountEnum){ saleOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
case ONE:
saleOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
break;
default:
break;
}
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:
switch (cjtAccountEnum){ manufactureOrderSyncCallOperate.execute(cjtEdiCallbackRequestVo);
case TWO: break;
manufactureOrderSyncCallOperate.execute(cjtEdiCallbackRequestVo); case PURCHASE_ORDER_CREATE:
break; case PURCHASE_ORDER_UPDATE:
default: case PURCHASE_ORDER_DELETE:
break; purchaseOrderSyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
} break;
case PURCHASE_ARRIVAL_ORDER_CREATE:
case PURCHASE_ARRIVAL_ORDER_UPDATE:
case PURCHASE_ARRIVAL_ORDER_DELETE:
purchaseArrivalOrderCallBackOperate.execute(cjtEdiCallbackRequestVo);
break;
case SALE_DELIVERY_CREATE:
case SALE_DELIVERY_UPDATE:
case SALE_DELIVERY_DELETE:
saleDeliverySyncCallBackOperate.execute(cjtEdiCallbackRequestVo);
break; break;
default: default:
saleDispatchSyncCallOperate.preHandle(cjtEdiCallbackRequestVo); saleDispatchSyncCallOperate.preHandle(cjtEdiCallbackRequestVo);

Loading…
Cancel
Save