Compare commits

..

No commits in common. 'b4f25d47ac6790b4adf698d0482cd89b997dd2a7' and '052fa3f7f4c50d4cd5852e303ea736ffb1f963b2' have entirely different histories.

@ -85,11 +85,7 @@ public class EdiController extends BaseController {
// public void receiveCjtTicket(Long id) {
// ErpLarkTempRelation erpLarkTempRelation = erpLarkTempRelationMapper.selectErpLarkTempRelationById(id);
// JSONObject jsonObject = JSONObject.parseObject(erpLarkTempRelation.getRemark());
// JSONObject req = new JSONObject();
// req.put("appKey",erpLarkTempRelation.getLarkKey());
// req.put("msgType",erpLarkTempRelation.getMethod());
// req.put("bizContent",jsonObject);
// execeuteByType(req);
// execeuteByType(jsonObject);
// }
/**
@ -128,6 +124,12 @@ public class EdiController extends BaseController {
redisCache.setCacheObject(buildUniqueKey(RedisConstants.CJT_TICKET_CACHE_KEY, appKey), appTicket, 24, TimeUnit.HOURS);
}
}
// else if ("SaleDispatchVoucher_Delete".equals(msgType)){
// log.info("畅捷通删除接口回调");
// String voucherCode = bizContent.getString("voucherCode");
// CJTEdiCallbackRequestVo cjtEdiCallbackRequestVo = new CJTEdiCallbackRequestVo(msgType, voucherCode);
// ediOperateService.cjtCallback(cjtEdiCallbackRequestVo);
// }
else{
cjtOperateCallBackFactory.handle(jsonObject);
}

@ -6,7 +6,6 @@ import com.lark.oapi.service.bitable.v1.model.CreateAppTableRecordRespBody;
import com.ruoyi.common.constant.RedisConstants;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.CjtAccountEnum;
import com.ruoyi.common.enums.CjtCallBackOperateEnum;
import com.ruoyi.common.enums.FlagStatus;
import com.ruoyi.flyingbook.LarkHelper.LarkRobotHelper;
import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper;
@ -63,8 +62,7 @@ public abstract class CJTOperateCallBackAbstract {
protected static final String REQUEST_ROOT_PATH = "https://openapi.chanjet.com";
public void execute(CJTEdiCallbackRequestVo req) {
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() + req.getMsgType() + req.getVoucherId());
try {
Boolean operateFlag = redisCache.setCacheObjectIfAbsent(operateCallBackFlag, operateCallBackFlag, 10L, TimeUnit.MINUTES);
if (!operateFlag) {
@ -230,13 +228,15 @@ public abstract class CJTOperateCallBackAbstract {
Map<String, Object> larkBody = buildLarkBody(header, detail, cjtAccountEnum);
request.setBody(larkBody);
CreateAppTableRecordRespBody respBody = larkTableHelper.addTableRecord(request);
req.setRetry(Boolean.FALSE);
String larkKey = respBody.getRecord().getRecordId();
relationList.add(buildErpLarkRelation(uniqueKey, larkKey, cjtAccountEnum.getCode(), toTableId, req.getVoucherId()));
} catch (Exception e) {
errorList.add(e.getMessage());
}
}
if (CollectionUtils.isEmpty(errorList)) {
req.setRetry(Boolean.FALSE);
}
if (!org.springframework.util.CollectionUtils.isEmpty(relationList)) {
erpLarkRelationMapper.batchInsert(relationList);
}

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

Loading…
Cancel
Save