From bb5f071b8b2e9d764515ffb729708ad753a4711c Mon Sep 17 00:00:00 2001 From: daixiaogang <2510234660@qq.com> Date: Thu, 7 Sep 2023 13:47:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PurchaseOrderServiceImpl.java | 124 +++++++++--------- .../java/com/ms/dal/bo/PurchaseOrderBO.java | 4 +- 2 files changed, 67 insertions(+), 61 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java index fa4ba3fb..d44d9a27 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java @@ -299,7 +299,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { List orderIds = orderList.stream().map(OpOrder::getOrderId).collect(Collectors.toList()); Map> orderIdAndPurchaseOrdersMap = getOrderIdAndPurchaseOrdersMap(shopIds, orderIds, filter, true, false); - Map shopIdAndShopInfoMap = shopService.getShopByIds(shopIds).stream().collect(Collectors.toMap(Shop::getShopId, x -> x,(v1,v2)->v1)); + Map shopIdAndShopInfoMap = shopService.getShopByIds(shopIds).stream().collect(Collectors.toMap(Shop::getShopId, x -> x, (v1, v2) -> v1)); Map orderIdAndSameOrderIdsMap = new HashMap<>(); // TODO: 2023/8/28 配置表已经没有相关字段 跳过 // if (ObjectUtil.isNotNull(filter.getIsShowSameReceiverOrder()) && filter.getIsShowSameReceiverOrder()) { @@ -331,7 +331,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { } List opOrderOutstorageHistoryRows = opOrderOutstorageHistoryService.getByIdList(opOrderOutstorageHistoryIds); - Map orderIdAndOpOrderOutstrorageHistoryMap = opOrderOutstorageHistoryRows.stream().collect(Collectors.toMap(OpOrderOutstorageHistory::getOrderId, x -> x,(v1,v2)->v1)); + Map orderIdAndOpOrderOutstrorageHistoryMap = opOrderOutstorageHistoryRows.stream().collect(Collectors.toMap(OpOrderOutstorageHistory::getOrderId, x -> x, (v1, v2) -> v1)); for (JSONObject order : orders) { if (isDs && !OrderConst.ORDER_STATUS_WAIT_SELLER_SEND_GOODS.equals(order.get("orderStatus"))) { @@ -694,7 +694,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { if (needItems) { List purchaseOrderIds = purchaseOrders.stream().map(x -> x.getPurchaseOrderId().toString()).collect(Collectors.toList()); - Map purchaseOrderItemsMap = getPurchaseOrderItemsMapByPurchaseOrderIds(shopIds, purchaseOrderIds, StatusConst.normal).stream().collect(Collectors.toMap(PurchaseOrderItem::getPurchaseOrderId, x -> x,(v1,v2)->v1)); + Map> purchaseOrderItemsMap = getPurchaseOrderItemsMapByPurchaseOrderIds(shopIds, purchaseOrderIds, StatusConst.normal).stream() + .collect(Collectors.groupingBy(PurchaseOrderItem::getPurchaseOrderId)); for (PurchaseOrderBO purchaseOrder : purchaseOrders) { if (purchaseOrderItemsMap.containsKey(purchaseOrder.getPurchaseOrderId().intValue())) { purchaseOrder.setItem(purchaseOrderItemsMap.get(purchaseOrder.getPurchaseOrderId().intValue())); @@ -739,7 +740,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { // } // } - return rows.stream().collect(Collectors.toMap(PurchaseOrderSetting::getPurchaseOrderId, x -> x,(v1,v2)->v1)); + return rows.stream().collect(Collectors.toMap(PurchaseOrderSetting::getPurchaseOrderId, x -> x, (v1, v2) -> v1)); } @Override @@ -1296,7 +1297,9 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { for (Map.Entry> entry : orderIdAndPurchaseOrdersMap.entrySet()) { purchaserOrderIds.addAll(entry.getValue().stream().map(PurchaseOrderBO::getPurchaseOrderId).collect(Collectors.toSet())); for (PurchaseOrderBO orderBO : entry.getValue()) { - purchaserOrderItemIds.add(orderBO.getItem().getPurchaseOrderItemId()); + for (PurchaseOrderItem purchasOrderItem : orderBO.getItem()) { + purchaserOrderItemIds.add(purchasOrderItem.getPurchaseOrderItemId()); + } } } // TODO: 2023/8/29 跳过 purchase_use_fixed_mobile_log purchase_order_platform_info purchase_order_need_check_status purchase_order_custom purchase_order_item_relate_source @@ -1339,7 +1342,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { List items = orderIdAndOpOrderChildMap.get(orderId); Map skuIdAndOrderChildMap = this.mergeOpOrderChildSameSku(items); List currentOrderAfterSales = ObjectUtil.isNotEmpty(orderIdAndAftersalesMap.get(orderId)) ? orderIdAndAftersalesMap.get(orderId) : new ArrayList<>(); - Map childOrderIdAndAfterSaleMap = currentOrderAfterSales.stream().collect(Collectors.toMap(AfterSale::getOrderId, x -> x,(v1,v2)->v1)); + Map childOrderIdAndAfterSaleMap = currentOrderAfterSales.stream().collect(Collectors.toMap(AfterSale::getOrderId, x -> x, (v1, v2) -> v1)); attachSourceItemInfoToOpOrderChilds(skuIdAndOrderChildMap, productIdAndProductToDsItemMap, childOrderIdAndAfterSaleMap); List sourceItemIds = skuIdAndOrderChildMap.values().stream().map(OpOrderChildBO::getSourceItemId).collect(Collectors.toList()); @@ -1372,7 +1375,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { // orderAddressChangeApply = orderIdAndOrderAddressChangeApplyMap[orderId]; - Map purchasePlatforms = ObjectUtil.isEmpty(returnPurchaseOrders) ? new HashMap<>() : returnPurchaseOrders.values().stream().collect(Collectors.toMap(x -> x.getString("purchasePlatform"), x -> x,(v1,v2)->v1)); + Map purchasePlatforms = ObjectUtil.isEmpty(returnPurchaseOrders) ? new HashMap<>() : returnPurchaseOrders.values().stream().collect(Collectors.toMap(x -> x.getString("purchasePlatform"), x -> x, (v1, v2) -> v1)); if (ObjectUtil.isEmpty(sourceItemIds) && purchasePlatforms.containsKey(PurchaseOrderConst.PURCHASE_PLATFORM1688_D_S)) { needDeleteOpOrderDsOrderIds.add(orderId); } @@ -1566,7 +1569,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { private void rebuildNoPurchaseOrderItems(Map skuIdAndOrderChildMap, List hasPurchaseSkuIds, List childOrderLogistics, List priceProtectionList, Map> childOrderIdAndGivenProductsMap, List returnOrderItems, List noPurchaseOrderItems, BigDecimal orderTotalAmount) { Map> childOrderIdAndLogisticsMap = childOrderLogistics.stream().collect(Collectors.groupingBy(OpOrderChildLogistics::getChildOrderId)); - Map childOrderIdAndPriceProtectionMap = priceProtectionList.stream().collect(Collectors.toMap(OpOrderPriceProtection::getChildOrderId, x -> x,(v1,v2)->v1)); + Map childOrderIdAndPriceProtectionMap = priceProtectionList.stream().collect(Collectors.toMap(OpOrderPriceProtection::getChildOrderId, x -> x, (v1, v2) -> v1)); for (Map.Entry entry : skuIdAndOrderChildMap.entrySet()) { OpOrderChildBO item = entry.getValue(); String skuSubNames = item.getSkuSubName(); @@ -1614,75 +1617,76 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { if (ObjectUtil.isNotEmpty(purchaseOrders)) { List returnPurchaseOrderItems = new ArrayList<>(); for (PurchaseOrderBO purchaseOrder : purchaseOrders) { - PurchaseOrderItem purchaseOrderItem = purchaseOrder.getItem(); - hasPurchaseSkuIds.add(purchaseOrderItem.getSkuId()); - Long skuId = purchaseOrderItem.getSkuId(); - OpOrderChildBO item = skuIdAndOrderChildMap.get(skuId); - List logisticsInfos = childOrderIdAndLogisticsMap.getOrDefault(item.getChildOrderId(), new ArrayList<>()); - List priceProtectionInfo = childOrderIdAndPriceProtectionMap.getOrDefault(item.getChildOrderId(), new ArrayList<>()); - List giveItems = childOrderIdAndGivenProductsMap.getOrDefault(Long.parseLong(item.getChildOrderId()), new ArrayList<>()); + for (PurchaseOrderItem purchaseOrderItem : purchaseOrder.getItem()) { + hasPurchaseSkuIds.add(purchaseOrderItem.getSkuId()); + Long skuId = purchaseOrderItem.getSkuId(); + OpOrderChildBO item = skuIdAndOrderChildMap.get(skuId); + List logisticsInfos = childOrderIdAndLogisticsMap.getOrDefault(item.getChildOrderId(), new ArrayList<>()); + List priceProtectionInfo = childOrderIdAndPriceProtectionMap.getOrDefault(item.getChildOrderId(), new ArrayList<>()); + List giveItems = childOrderIdAndGivenProductsMap.getOrDefault(Long.parseLong(item.getChildOrderId()), new ArrayList<>()); - String skuSubNames = item.getSkuSubName(); + String skuSubNames = item.getSkuSubName(); - JSONObject returnPurchaseOrderItem = new JSONObject(); + JSONObject returnPurchaseOrderItem = new JSONObject(); - returnPurchaseOrderItem.put("purchaseOrderItemId", purchaseOrderItem.getPurchaseOrderItemId()); - // TODO: 2023/8/29 跳过 + returnPurchaseOrderItem.put("purchaseOrderItemId", purchaseOrderItem.getPurchaseOrderItemId()); + // TODO: 2023/8/29 跳过 // returnPurchaseOrderItem.put("purchaseItemCode", purchaseOrderItem.get("code")); - returnPurchaseOrderItem.put("childOrderId", item.getChildOrderId()); - returnPurchaseOrderItem.put("orderId", item.getOrderId()); - // TODO: 2023/8/29 跳过 + returnPurchaseOrderItem.put("childOrderId", item.getChildOrderId()); + returnPurchaseOrderItem.put("orderId", item.getOrderId()); + // TODO: 2023/8/29 跳过 // returnPurchaseOrderItem.put("shopId", item.get("shop_id")); - returnPurchaseOrderItem.put("code", item.getCode()); - returnPurchaseOrderItem.put("itemNum", item.getItemNum()); - returnPurchaseOrderItem.put("wareId", purchaseOrderItem.getWareId()); - returnPurchaseOrderItem.put("skuId", purchaseOrderItem.getSkuId()); - returnPurchaseOrderItem.put("purchaseUrl", purchaseOrderItem.getPurchaseUrl()); - returnPurchaseOrderItem.put("purchasePrice", purchaseOrderItem.getPurchasePrice()); - returnPurchaseOrderItem.put("purchaseNum", purchaseOrderItem.getPurchaseNum()); - returnPurchaseOrderItem.put("outSkuId", item.getOutSkuId()); - returnPurchaseOrderItem.put("title", item.getProductName()); - returnPurchaseOrderItem.put("skuName", item.getProductName() + "_" + String.join(" ", skuSubNames)); - returnPurchaseOrderItem.put("jdPrice", CommonTool.correctCentToYuan(item.getCouponAmount())); - returnPurchaseOrderItem.put("itemTotal", item.getComboNum()); - returnPurchaseOrderItem.put("logo", item.getProductPic()); - returnPurchaseOrderItem.put("totalPrice", item.getTotalAmount()); - returnPurchaseOrderItem.put("orderStatus", item.getOrderStatus()); - returnPurchaseOrderItem.put("skuSubName", String.join(" ", skuSubNames)); - returnPurchaseOrderItem.put("couponPrice", CommonTool.correctCentToYuan(item.getCouponAmount())); - returnPurchaseOrderItem.put("totalAmount", CommonTool.correctCentToYuan(item.getTotalAmount())); - returnPurchaseOrderItem.put("shopCouponAmount", CommonTool.correctCentToYuan(item.getShopCouponAmount())); - // TODO: 2023/8/29 跳过 - returnPurchaseOrderItem.put("url", CommonTool.buildDdProductUrl(item.getProductId())); - returnPurchaseOrderItem.put("sourceItemId", item.getSourceItemId()); - returnPurchaseOrderItem.put("sourceSellerId", item.getSourceSellerId()); - returnPurchaseOrderItem.put("sourcePlatform", item.getSource_platform()); - returnPurchaseOrderItem.put("logisticsInfos", JSONArray.toJSONString(logisticsInfos)); - returnPurchaseOrderItem.put("priceProtection", priceProtectionInfo); - returnPurchaseOrderItem.put("dsRefundStatus", item.getDsRefundStatus()); - returnPurchaseOrderItem.put("dsRefundStatusName", item.getDsRefundStatusName()); - returnPurchaseOrderItem.put("cBiz", item.getCBiz()); - returnPurchaseOrderItem.put("isPurchase", hasPurchaseSkuIds.contains(item.getSkuId()) ? 1 : 0); - returnPurchaseOrderItem.put("sourceItem", item.getSourceItem()); - // TODO: 2023/8/29 跳过 + returnPurchaseOrderItem.put("code", item.getCode()); + returnPurchaseOrderItem.put("itemNum", item.getItemNum()); + returnPurchaseOrderItem.put("wareId", purchaseOrderItem.getWareId()); + returnPurchaseOrderItem.put("skuId", purchaseOrderItem.getSkuId()); + returnPurchaseOrderItem.put("purchaseUrl", purchaseOrderItem.getPurchaseUrl()); + returnPurchaseOrderItem.put("purchasePrice", purchaseOrderItem.getPurchasePrice()); + returnPurchaseOrderItem.put("purchaseNum", purchaseOrderItem.getPurchaseNum()); + returnPurchaseOrderItem.put("outSkuId", item.getOutSkuId()); + returnPurchaseOrderItem.put("title", item.getProductName()); + returnPurchaseOrderItem.put("skuName", item.getProductName() + "_" + String.join(" ", skuSubNames)); + returnPurchaseOrderItem.put("jdPrice", CommonTool.correctCentToYuan(item.getCouponAmount())); + returnPurchaseOrderItem.put("itemTotal", item.getComboNum()); + returnPurchaseOrderItem.put("logo", item.getProductPic()); + returnPurchaseOrderItem.put("totalPrice", item.getTotalAmount()); + returnPurchaseOrderItem.put("orderStatus", item.getOrderStatus()); + returnPurchaseOrderItem.put("skuSubName", String.join(" ", skuSubNames)); + returnPurchaseOrderItem.put("couponPrice", CommonTool.correctCentToYuan(item.getCouponAmount())); + returnPurchaseOrderItem.put("totalAmount", CommonTool.correctCentToYuan(item.getTotalAmount())); + returnPurchaseOrderItem.put("shopCouponAmount", CommonTool.correctCentToYuan(item.getShopCouponAmount())); + // TODO: 2023/8/29 跳过 + returnPurchaseOrderItem.put("url", CommonTool.buildDdProductUrl(item.getProductId())); + returnPurchaseOrderItem.put("sourceItemId", item.getSourceItemId()); + returnPurchaseOrderItem.put("sourceSellerId", item.getSourceSellerId()); + returnPurchaseOrderItem.put("sourcePlatform", item.getSource_platform()); + returnPurchaseOrderItem.put("logisticsInfos", JSONArray.toJSONString(logisticsInfos)); + returnPurchaseOrderItem.put("priceProtection", priceProtectionInfo); + returnPurchaseOrderItem.put("dsRefundStatus", item.getDsRefundStatus()); + returnPurchaseOrderItem.put("dsRefundStatusName", item.getDsRefundStatusName()); + returnPurchaseOrderItem.put("cBiz", item.getCBiz()); + returnPurchaseOrderItem.put("isPurchase", hasPurchaseSkuIds.contains(item.getSkuId()) ? 1 : 0); + returnPurchaseOrderItem.put("sourceItem", item.getSourceItem()); + // TODO: 2023/8/29 跳过 // returnPurchaseOrderItem.put("estimatedCommission", item.get("estimated_commission")); - returnPurchaseOrderItem.put("givenProductItems", JSONArray.toJSONString(giveItems)); - // TODO: 2023/8/29 跳过 + returnPurchaseOrderItem.put("givenProductItems", JSONArray.toJSONString(giveItems)); + // TODO: 2023/8/29 跳过 // if (purchaseOrderItemRelateSourceMap.containsKey(purchaseOrderItem.get("purchase_order_id"))) { // returnPurchaseOrderItem.put("isManual", purchaseOrderItemRelateSourceMap.get(purchaseOrderItem.get("purchase_order_id")).equals("manual")); // } else { // returnPurchaseOrderItem.put("isManual", purchaseOrderItem.get("purchase_url").isEmpty()); // } - returnPurchaseOrderItem.put("isManual", purchaseOrderItem.getPurchaseUrl().isEmpty()); - // TODO: 2023/8/29 跳过 + returnPurchaseOrderItem.put("isManual", purchaseOrderItem.getPurchaseUrl().isEmpty()); + // TODO: 2023/8/29 跳过 // returnPurchaseOrderItem['purchaseClickTimes'] = 0; // foreach(opItemPurchaseClicks as opItemPurchaseClick) { // if (opItemPurchaseClick['sku_id'] == item['combo_id']) { // returnPurchaseOrderItem['purchaseClickTimes'] += opItemPurchaseClick['click_times']; // } // } - returnPurchaseOrderItems.add(returnPurchaseOrderItem); - skuIdAndPurchaseOrderIdMap.put(purchaseOrderItem.getSkuId(), purchaseOrder.getPurchaseOrderId()); + returnPurchaseOrderItems.add(returnPurchaseOrderItem); + skuIdAndPurchaseOrderIdMap.put(purchaseOrderItem.getSkuId(), purchaseOrder.getPurchaseOrderId()); + } JSONObject returnPurchaseSetting = new JSONObject(); if (ObjectUtil.isNotNull(purchaseOrder.getPurchaseSetting())) { returnPurchaseSetting.put("isAddConsigneeSuffix", purchaseOrder.getPurchaseSetting().getIsAddConsigneeSuffix()); diff --git a/ms-dal/src/main/java/com/ms/dal/bo/PurchaseOrderBO.java b/ms-dal/src/main/java/com/ms/dal/bo/PurchaseOrderBO.java index 115b8f38..c2d0cf3b 100644 --- a/ms-dal/src/main/java/com/ms/dal/bo/PurchaseOrderBO.java +++ b/ms-dal/src/main/java/com/ms/dal/bo/PurchaseOrderBO.java @@ -1,5 +1,7 @@ package com.ms.dal.bo; +import java.util.List; + import com.ms.dal.entity.PurchaseOrder; import com.ms.dal.entity.PurchaseOrderItem; import com.ms.dal.entity.PurchaseOrderSetting; @@ -8,7 +10,7 @@ import lombok.Data; @Data public class PurchaseOrderBO extends PurchaseOrder { - private PurchaseOrderItem item; + private List item; private PurchaseOrderSetting purchaseSetting; From f618cc705efcbf508c899be297944a3962b5f0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?cxxxxxxx=E8=AF=A6?= <286460656@qq.com> Date: Thu, 7 Sep 2023 13:52:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=93=BA=E8=B4=A7=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- .../ms/api/spi/move/SaveCurrentShopMoveSettingService.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc6077bb..e0c3de78 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ curl --location --request POST 'localhost:8080/base/cloud/spi' \ --data-raw '{ "appId":"7264840234423027259", "authId":"4463798", -"method":"searchDSProductCatTree", -"data":"{\"status\":\"processing\",\"pageSize\":20,\"pageNo\":1}" +"method":"saveCurrentShopMoveSetting", +"data":"{\"moveShopSettingId\":6,\"shopId\":4463798,\"configName\":\"默认配置\",\"isConfigDefault\":0,\"mobile\":null,\"deliveryDelayDay\":48,\"freightTemplateId\":29667599,\"supply7dayReturn\":2,\"reduceType\":1,\"moveOnsaleType\":1,\"pricePercent\":null,\"priceAdd\":null,\"priceSub\":null,\"priceTail\":0,\"priceDecimal\":\"clearFen\",\"priceDecimalTypeRedio\":\"priceDecimalType\",\"priceDecimalType\":\"holdFenJiao\",\"priceDecimalDiyValue\":null,\"isPriceAddPostFee\":0,\"basePriceType\":0,\"priceMode\":null,\"aliPriceType\":\"consign\",\"noConsignPriceType\":1,\"skuMinPriceStatus\":0,\"skuMinPriceType\":0,\"addSkuMinPriceType\":0,\"addSkuMinPricePricePercent\":null,\"addSkuMinPricePriceAdd\":null,\"addSkuMinPricePriceSub\":null,\"addSkuMinPricePriceTail\":0,\"addSkuMinPricePriceDecimal\":null,\"addSkuMinPricePriceDecimalDiyValue\":null,\"addSkuMinPriceSkuName\":null,\"addSkuMinPriceQuantity\":null,\"addSkuMinPriceColorImg\":null,\"addSkuPriceSource\":0,\"updateSkuMinPricePricePercent\":null,\"updateSkuMinPricePriceAdd\":null,\"updateSkuMinPricePriceSub\":null,\"updateSkuMinPricePriceTail\":0,\"updateSkuMinPricePriceDecimal\":null,\"updateSkuMinPricePriceDecimalDiyValue\":null,\"updateSkuMinPriceQuantity\":null,\"updateSkuPriceSource\":0,\"filterOutLinks\":0,\"titleSearch\":null,\"titleSearchId\":null,\"titleReplace\":null,\"titleReplaceId\":null,\"titlePrefix\":null,\"titleSuffix\":null,\"titleDeleteId\":null,\"titleDelLetter\":0,\"titleDelNumber\":0,\"titleDelBlank\":0,\"titleDelESymbol\":0,\"titleDelProductNum\":0,\"titleDelBrand\":0,\"titleDelBracket\":null,\"height\":null,\"width\":null,\"length\":null,\"brandId\":null,\"brandName\":null,\"isCopyRecommendRemark\":0,\"recommendRemark\":null,\"recommendRemarkSearchId\":null,\"recommendRemarkReplaceId\":null,\"recommendRemarkPrefixId\":null,\"recommendRemarkSuffixId\":null,\"itemNumType\":0,\"itemNumFetchBankType\":\"move_setting\",\"itemNumTypeOther\":0,\"itemNumPrefix\":null,\"itemNumSuffix\":null,\"isBuildSkuCode\":0,\"skuCodeRule\":null,\"skuCodeSeparator\":null,\"skuCodeChinese\":null,\"skuCodeNumStart\":null,\"skuCodeNumStep\":null,\"skuCodeItemNumEmptyOperate\":null,\"copyTaobaoCidOnly\":null,\"copyJdCidOnly\":null,\"copy1688CidOnly\":null,\"copyPddCidOnly\":null,\"copyLtaoCidOnly\":null,\"isTitleOverFlowDelete\":0,\"titleOverFlowDeleteType\":null,\"processMainImageType\":null,\"delMainImgHeadNum\":null,\"delMainImgTailNum\":null,\"delMainImgIndexList\":null,\"keepFirstMainImg\":0,\"tailorImgType\":0,\"mainImgAutoFill\":0,\"useSourceMobileDesc\":0,\"descPrefixId\":null,\"descSuffixId\":null,\"descPrefixImgId\":null,\"descSuffixImgId\":null,\"descCopyType\":\"copy\",\"isOnlyImg\":0,\"delDescImgHeadNum\":null,\"delDescImgTailNum\":null,\"weight\":null,\"quantity\":null,\"resetSkuStockNum\":null,\"resetSkuZeroStockNum\":null,\"delSkuStockNum\":null,\"skipCopied\":0,\"skipWithoutColorImg\":0,\"filterEmptyColorImg\":0,\"skipForSaleProduct\":0,\"skipHasBrandName\":0,\"skip3cProduct\":0,\"skipGlobal\":0,\"skipOldWare\":0,\"skipSupermarket\":0,\"skipSeason\":null,\"skipStockNum\":0,\"skipSaleCount\":null,\"skipMinPrice\":null,\"skipMaxPrice\":null,\"isSkipMinCreditLevel\":0,\"isSkipMaxCreditLevel\":0,\"skipMinCreditLevel\":0,\"skipMaxCreditLevel\":0,\"skipReviewsCnt\":null,\"skipReviewWellRate\":0,\"skipTitleKeywordId\":null,\"skipSkuAliasKeywordId\":null,\"skipBrandKeywordId\":null,\"skipYushou\":0,\"skipSendCity\":0,\"skipSendCityInfoId\":null,\"skipNoFromDs\":0,\"baseMarketPriceType\":0,\"marketPricePercent\":null,\"marketPriceAdd\":null,\"marketPriceSub\":null,\"marketPriceTail\":null,\"marketPriceDecimal\":null,\"marketPriceDecimalDiyValue\":null,\"isAutoMatchCategory\":0,\"skipMatchCategoryFail\":0,\"matchFailUseCategoryId\":null,\"moveMatchMainCids\":null,\"autoMatchCategoryId\":null,\"forceCategoryId\":null,\"payType\":0,\"presellType\":0,\"presellDelay\":0,\"presellDeliveryType\":0,\"presellEndTime\":\"2023-09-07T05:33:27.000+0000\",\"presellEndTimeType\":0,\"presellEndTimeDelay\":0,\"presellTimeSkuSpecNameAndStockPercentMap\":null,\"presellTimeSkuSpecNameAndStockPercentMapV2\":null,\"placeOrderDelay\":0,\"presellConfigLevel\":0,\"presellConfigLevelDeliveryDelayDay\":0,\"stepStockNum\":null,\"stockType\":null,\"assocIds\":null,\"limitPerBuyer\":null,\"maximumPerOrder\":null,\"minimumPerOrder\":null,\"presetAttrsId\":null,\"presetCateAttrsId\":null,\"skuAliasDeleteId\":null,\"skuSearchId\":null,\"skuReplaceId\":null,\"isAutoFillingMainImage\":0,\"imageNumFillingToNum\":0,\"isAutoFillingUseSkuImg\":0,\"isAutoFillingUseDescImg\":0,\"isAutoFillingFlipMainImg\":0,\"isAutoFillingRotatingMainImg\":0,\"isAutoFillingCopyMainImg\":0,\"sourcePostFeePriceAddValue\":null,\"gmtCreate\":null,\"gmtModified\":null,\"qualityReportId\":null,\"classQualityId\":null,\"skipShopNameId\":null,\"taobaoMainImageSource\":null,\"useUserBanWord\":0,\"autoFilterBanWord\":0,\"useSystemBanWord\":0,\"enableRangePrice\":0,\"rangePriceGroup\":null,\"isCopySourceVideo\":0,\"isUseSourceWhiteBgImg\":0,\"buildWhiteBgImgUseMainImgIndex\":0,\"isUseSourceLongPic\":1,\"isBuildLongPic\":0,\"buildLongPicMode\":\"scaleUp\",\"buildLongPicUseMainImgIndex\":0,\"commonSizeTemplate\":\"\",\"appendSizeTemplateToDescPosition\":\"head\",\"isAppendSizeTemplateToDesc\":0,\"rangePriceGroupId\":0,\"useSourcePresell\":0}" }' diff --git a/ms-biz/src/main/java/com/ms/api/spi/move/SaveCurrentShopMoveSettingService.java b/ms-biz/src/main/java/com/ms/api/spi/move/SaveCurrentShopMoveSettingService.java index 1b3780b7..d552e260 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/move/SaveCurrentShopMoveSettingService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/move/SaveCurrentShopMoveSettingService.java @@ -45,9 +45,13 @@ public class SaveCurrentShopMoveSettingService extends SPIBaseService implements if (fields.getPriceDecimalTypeRedio().equals("priceTail")) { moveShopSettings.setPriceTail(fields.getPriceTail()); moveShopSettings.setPriceDecimal(null); + moveShopSettings.setPriceDecimalType(fields.getPriceDecimalType()); + moveShopSettings.setPriceDecimalTypeRedio(fields.getPriceDecimalTypeRedio()); } else if (fields.getPriceDecimalTypeRedio().equals("priceDecimalType")) { moveShopSettings.setPriceTail(0); moveShopSettings.setPriceDecimal(fields.getPriceDecimalType()); + moveShopSettings.setPriceDecimalType(fields.getPriceDecimalType()); + moveShopSettings.setPriceDecimalTypeRedio(fields.getPriceDecimalTypeRedio()); } moveShopSettings.setMoveOnsaleType(fields.getMoveOnsaleType()); moveShopSettings.setFreightTemplateId(fields.getFreightTemplateId()); From bdf32665cf922695a12ccb8b286aa58c21f49657 Mon Sep 17 00:00:00 2001 From: daixiaogang <2510234660@qq.com> Date: Thu, 7 Sep 2023 14:16:29 +0800 Subject: [PATCH 3/4] opUnlockTimeoutQueueTimer --- .../java/com/ms/api/service/QueueService.java | 2 + .../ms/api/service/impl/QueueServiceImpl.java | 93 +++++++++++++++++++ .../OpUnlockTimeoutQueueTimerService.java | 31 +++++++ .../java/com/ms/dal/mapper/QueueMapper.java | 9 ++ .../src/main/resources/mapper/QueueMapper.xml | 9 ++ 5 files changed, 144 insertions(+) create mode 100644 ms-biz/src/main/java/com/ms/api/spi/timer/OpUnlockTimeoutQueueTimerService.java diff --git a/ms-biz/src/main/java/com/ms/api/service/QueueService.java b/ms-biz/src/main/java/com/ms/api/service/QueueService.java index d68a96b8..3aa837c8 100644 --- a/ms-biz/src/main/java/com/ms/api/service/QueueService.java +++ b/ms-biz/src/main/java/com/ms/api/service/QueueService.java @@ -7,4 +7,6 @@ import com.alibaba.fastjson.JSONObject; public interface QueueService { Map allocBufferToQueueByShopAvg(String bufferName, String queueName, JSONObject filter, int maxQueueCount, Integer shopLimit); + + int unlockTimeoutSolidRedisQueue(String tableName, int heartbeatExpiredSeconds, String status); } diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/QueueServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/QueueServiceImpl.java index e3c6dd1d..07f49ed0 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/QueueServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/QueueServiceImpl.java @@ -1,13 +1,20 @@ package com.ms.api.service.impl; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Set; +import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; +import com.ms.api.consts.QueueConst; +import com.ms.api.consts.RedisKeyConst; import com.ms.api.service.QueueService; import com.ms.api.tool.CommonTool; import com.ms.dal.mapper.QueueMapper; @@ -36,6 +43,92 @@ public class QueueServiceImpl implements QueueService { return allotShopMoveBufferCnt(shopIdAndCntMap, allowMoveCnt); } + @Override + public int unlockTimeoutSolidRedisQueue(String tableName, int heartbeatExpiredSeconds, String status) { + int c1 = unlockSolidRedisDeadQueue(tableName, heartbeatExpiredSeconds, status); + int c2 = unlockSolidRedisSkipQueue(tableName, status); + return c1 + c2; + } + + private int unlockSolidRedisSkipQueue(String queueName, String status) { + String queueRedisKey = RedisKeyConst.getQueueRedisKey(queueName, false); + List redisIds = redisTemplate.opsForList().range(queueRedisKey, 0, -1); + if (ObjectUtil.isEmpty(redisIds)) { + redisIds = new ArrayList<>(); + } + StringBuilder where = new StringBuilder(); + if (StrUtil.isNotBlank(status)) { + where.append(String.format(" AND status = '%s'", status)); + } + String queueIdColumnName = QueueConst.getQueueIdColumnName(queueName); + Long startQueueId = 0L; + int limit = 100; + List> allQueueList = new ArrayList<>(); + while (true) { + StringBuilder queueIdWhere = new StringBuilder(" WHERE locked = 0 "); + if (startQueueId > 0) { + queueIdWhere.append(String.format(" AND %s > %s", queueIdColumnName, startQueueId)); + } + if (ObjectUtil.isNotNull(where) && StrUtil.isNotBlank(where.toString())) { + queueIdWhere.append(where); + } + queueIdWhere.append(String.format(" order by %s asc limit %s", queueIdColumnName, limit)); + List> queueList = queueMapper.select(queueName, queueIdWhere.toString()); + if (ObjectUtil.isEmpty(queueList)) { + break; + } + startQueueId = (Long) queueList.get(queueList.size() - 1).getOrDefault(queueIdColumnName, null); + allQueueList.addAll(queueList); + if (queueList.size() < limit) { + break; + } + } + if (ObjectUtil.isEmpty(allQueueList)) { + return 0; + } + List newRedisIds = redisTemplate.opsForList().range(queueRedisKey, 0, -1); + if (ObjectUtil.isEmpty(newRedisIds)) { + newRedisIds = new ArrayList<>(); + } + Set tempRedisIds = new HashSet<>(); + tempRedisIds.addAll(redisIds); + tempRedisIds.addAll(newRedisIds); + for (Map queue : allQueueList) { + Long queueId = (Long) queue.getOrDefault(queueIdColumnName, null); + if (ObjectUtil.isNotNull(queueId)) { + String queueIdStr = queueId.toString(); + if (redisIds.contains(queueIdStr)) { + continue; + } + redisTemplate.opsForList().leftPush(queueRedisKey, queueIdStr); + } + } + return allQueueList.size(); + } + + private int unlockSolidRedisDeadQueue(String tableName, int heartbeatExpiredSeconds, String status) { + DateTime deadTime = DateUtil.offsetSecond(new Date(), -heartbeatExpiredSeconds); + String where = String.format(" WHERE locked > 0 AND gmt_last_heartbeat < '%s' ", DateUtil.formatDateTime(deadTime)); + if (StrUtil.isBlank(status)) { + where = where.concat(String.format(" and `status` = %s ", status)); + } + List> queueList = queueMapper.select(tableName, where); + if (ObjectUtil.isEmpty(queueList)) { + return 0; + } + String queueIdColumnName = QueueConst.getQueueIdColumnName(tableName); + int ar1 = 0; + for (Map queue : queueList) { + Long queueId = (Long) queue.get(queueIdColumnName); + if (ObjectUtil.isNotNull(queueId)) { + ar1 = queueMapper.updateLocked(tableName, queueIdColumnName, queueId, 0, DateUtil.now()); + String queueRedisKey = RedisKeyConst.getQueueRedisKey(queueIdColumnName, false); + redisTemplate.opsForList().leftPush(queueRedisKey, queueId.toString()); + } + } + return queueList.size(); + } + private Map rebuildShopIdAndCntMapByShopLimit(Map shopIdAndCntMap, String queueName, Integer shopLimit) { if (ObjectUtil.isEmpty(shopIdAndCntMap) || ObjectUtil.isNull(shopLimit)) { return shopIdAndCntMap; diff --git a/ms-biz/src/main/java/com/ms/api/spi/timer/OpUnlockTimeoutQueueTimerService.java b/ms-biz/src/main/java/com/ms/api/spi/timer/OpUnlockTimeoutQueueTimerService.java new file mode 100644 index 00000000..7db462f0 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/api/spi/timer/OpUnlockTimeoutQueueTimerService.java @@ -0,0 +1,31 @@ +package com.ms.api.spi.timer; + +import com.jinritemai.cloud.base.api.BaseRequest; +import com.jinritemai.cloud.base.api.BaseResponse; +import com.jinritemai.cloud.base.api.ExtensionService; +import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.api.common.R; +import com.ms.api.common.Ret; +import com.ms.api.common.TimerBaseService; +import com.ms.api.consts.StatusConst; +import com.ms.api.consts.TblConst; +import com.ms.api.dto.ItemDTO; +import com.ms.api.service.QueueService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; + +@ExtensionService("opUnlockTimeoutQueueTimer") +@Slf4j +public class OpUnlockTimeoutQueueTimerService extends TimerBaseService implements ExtensionServiceHandler { + + @Autowired + private QueueService queueService; + + @Override + public BaseResponse handle(BaseRequest req) { + queueService.unlockTimeoutSolidRedisQueue(TblConst.op_order_rsync_queue, 300, StatusConst.wait); + queueService.unlockTimeoutSolidRedisQueue(TblConst.op_order_rsync_page_queue, 300, null); + return R.ok(Ret.success()); + } + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/QueueMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/QueueMapper.java index 7bacefa3..b755b9c1 100644 --- a/ms-dal/src/main/java/com/ms/dal/mapper/QueueMapper.java +++ b/ms-dal/src/main/java/com/ms/dal/mapper/QueueMapper.java @@ -1,5 +1,6 @@ package com.ms.dal.mapper; +import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.MapKey; @@ -13,4 +14,12 @@ public interface QueueMapper { @MapKey("shop_id") Map> selectShopIdAndCnt(@Param("bufferName") String bufferName, @Param("whereStr") String whereStr); + + List> select(@Param("tableName") String tableName, @Param("whereStr") String where); + + int updateLocked(@Param("tableName") String tableName, + @Param("queueIdName") String queueIdName, + @Param("queueId") Long queueId, + @Param("locked") int locked, + @Param("gmtModified") String gmtModified); } diff --git a/ms-dal/src/main/resources/mapper/QueueMapper.xml b/ms-dal/src/main/resources/mapper/QueueMapper.xml index afaca21b..039e4f1a 100644 --- a/ms-dal/src/main/resources/mapper/QueueMapper.xml +++ b/ms-dal/src/main/resources/mapper/QueueMapper.xml @@ -3,6 +3,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + update ${bufferName} + set locked =#{locked},gmt_modified='${gmtModified}' + where ${queueIdName} = ${queueId} + + From 6d324ac499fe704c70ae123019837615d188f138 Mon Sep 17 00:00:00 2001 From: daixiaogang <2510234660@qq.com> Date: Thu, 7 Sep 2023 14:38:30 +0800 Subject: [PATCH 4/4] clearRedisRsyncOpOrderCompletedMap --- .../com/ms/api/service/OpOrderService.java | 3 + .../api/service/impl/OpOrderServiceImpl.java | 12 ++- ...rRedisRsyncOpOrderCompletedMapService.java | 73 +++++++++++++++++++ .../dal/mapper/OpOrderRsyncQueueMapper.java | 4 +- .../mapper/OpOrderRsyncQueueMapper.xml | 8 ++ 5 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 ms-biz/src/main/java/com/ms/api/spi/timer/ClearRedisRsyncOpOrderCompletedMapService.java diff --git a/ms-biz/src/main/java/com/ms/api/service/OpOrderService.java b/ms-biz/src/main/java/com/ms/api/service/OpOrderService.java index 84d6ea4f..a6234c31 100644 --- a/ms-biz/src/main/java/com/ms/api/service/OpOrderService.java +++ b/ms-biz/src/main/java/com/ms/api/service/OpOrderService.java @@ -9,6 +9,7 @@ import com.ms.api.dto.order.OriginalAndCustomConsigneeInfoResponseDTO; import com.ms.api.dto.order.RsyncOpOrderByOrderIdsResultDTO; import com.ms.dal.entity.OpOrder; import com.ms.dal.entity.OpOrderRsyncPageQueue; +import com.ms.dal.entity.OpOrderRsyncQueue; import java.util.*; @@ -117,4 +118,6 @@ public interface OpOrderService { void moveOpPageBufferToQueue(Map shopIdAndMoveCntMap); + List getOpOrderRsyncQueuesByQueueIds(List queueIdsChunk); + } diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java index 6612751d..2c1f80d9 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java @@ -961,7 +961,7 @@ public class OpOrderServiceImpl implements OpOrderService { afterSaleData.setGmtCreate(new Date()); afterSaleDatas.add(afterSaleData); - Map childs = childInfoDatas.stream().collect(Collectors.toMap(OpOrderChild::getChildOrderId, x -> x,(v1,v2)->v1)); + Map childs = childInfoDatas.stream().collect(Collectors.toMap(OpOrderChild::getChildOrderId, x -> x, (v1, v2) -> v1)); if (ObjectUtil.isNotEmpty(skuOrder.getMasterSkuOrderIdList())) { for (String masterSkuOrderId : skuOrder.getMasterSkuOrderIdList()) { OpOrderGivenProduct item = new OpOrderGivenProduct(); @@ -1998,11 +1998,19 @@ public class OpOrderServiceImpl implements OpOrderService { startBufferId = chunkBufferList.stream().map(OpOrderRsyncPageBuffer::getOpOrderRsyncPageBufferId).max(Long::compare).orElse(0L); startMoveOpPageBufferToQueue(chunkBufferList, shopIdAndMoveCntMap); shopIdAndMoveCntMap = shopIdAndMoveCntMap.entrySet().stream().filter(r -> r.getValue() > 0) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,(v1,v2)->v1)); + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> v1)); } log.info("end moveOpPageBufferToQueue"); } + @Override + public List getOpOrderRsyncQueuesByQueueIds(List queueIds) { + if (ObjectUtil.isEmpty(queueIds)) { + return new ArrayList<>(); + } + return opOrderRsyncQueueMapper.getByIdList(queueIds); + } + private ApiResult startMoveOpPageBufferToQueue(List bufferList, Map shopIdAndMoveCntMap) { List deleteBufferIds = new ArrayList<>(); List insertQueueList = new ArrayList<>(); diff --git a/ms-biz/src/main/java/com/ms/api/spi/timer/ClearRedisRsyncOpOrderCompletedMapService.java b/ms-biz/src/main/java/com/ms/api/spi/timer/ClearRedisRsyncOpOrderCompletedMapService.java new file mode 100644 index 00000000..244ecc44 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/api/spi/timer/ClearRedisRsyncOpOrderCompletedMapService.java @@ -0,0 +1,73 @@ +package com.ms.api.spi.timer; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.jinritemai.cloud.base.api.BaseRequest; +import com.jinritemai.cloud.base.api.BaseResponse; +import com.jinritemai.cloud.base.api.ExtensionService; +import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.api.common.R; +import com.ms.api.common.Ret; +import com.ms.api.common.TimerBaseService; +import com.ms.api.consts.RedisKeyConst; +import com.ms.api.consts.StatusConst; +import com.ms.api.dto.ItemDTO; +import com.ms.api.service.OpOrderService; +import com.ms.dal.entity.OpOrderRsyncQueue; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; + +@ExtensionService("clearRedisRsyncOpOrderCompletedMap") +@Slf4j +public class ClearRedisRsyncOpOrderCompletedMapService extends TimerBaseService implements ExtensionServiceHandler { + + @Autowired + private RedisTemplate redisTemplate; + + @Autowired + private OpOrderService opOrderService; + + @Override + public BaseResponse handle(BaseRequest req) { + log.info(" start clearRedisRsyncOpOrderCompletedMap"); + List queueIds = new ArrayList<>((Set) (Set) redisTemplate.opsForHash().keys(RedisKeyConst.RSYNC_OP_ORDER_QUEUE_COMPLETED_MAP)); + if (ObjectUtil.isEmpty(queueIds)) { + return R.ok(Ret.success()); + } + List> queueIdsChunks = new ArrayList<>(); + for (int i = 0; i < queueIds.size(); i += 50) { + int endIndex = Math.min(i + 50, queueIds.size()); + queueIdsChunks.add(CollectionUtil.sub(queueIds, i, endIndex)); + } + for (List queueIdsChunk : queueIdsChunks) { + List queueInfos = opOrderService.getOpOrderRsyncQueuesByQueueIds(queueIdsChunk); + Map queueIdAndQueueInfoMap = queueInfos.stream().collect(Collectors.toMap(x -> x.getOpOrderRsyncQueueId().toString(), x -> x, (v1, v2) -> v1)); + for (String queueId : queueIdsChunk) { + OpOrderRsyncQueue queueInfo = queueIdAndQueueInfoMap.getOrDefault(queueId, null); + boolean needDelete = false; + if (ObjectUtil.isNull(queueInfo)) { + needDelete = true; + } else if (queueInfo.getStatus().equals(StatusConst.processing) && queueInfo.getGmtCreate().compareTo(DateUtil.offsetDay(new Date(), -1)) < 0) { + needDelete = true; + } + if (!needDelete) { + continue; + } + redisTemplate.opsForHash().delete(RedisKeyConst.RSYNC_OP_ORDER_QUEUE_COMPLETED_MAP, queueId); + log.info("deleteQueueId:[{}]", queueId); + } + } + log.info(" end clearRedisRsyncOpOrderCompletedMap"); + return R.ok(Ret.success()); + } + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderRsyncQueueMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderRsyncQueueMapper.java index 0ce4f9ef..672ed92e 100644 --- a/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderRsyncQueueMapper.java +++ b/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderRsyncQueueMapper.java @@ -30,5 +30,7 @@ public interface OpOrderRsyncQueueMapper { OpOrderRsyncQueue queryFirstRowByQueueId(@Param("queueId") String queueId); - OpOrderRsyncQueue getLastByQueueIdAndStatus(@Param("queueId")Long queueId, @Param("status")String status); + OpOrderRsyncQueue getLastByQueueIdAndStatus(@Param("queueId") Long queueId, @Param("status") String status); + + List getByIdList(@Param("queueIds") List queueIds); } diff --git a/ms-dal/src/main/resources/mapper/OpOrderRsyncQueueMapper.xml b/ms-dal/src/main/resources/mapper/OpOrderRsyncQueueMapper.xml index dd22771f..387f533e 100644 --- a/ms-dal/src/main/resources/mapper/OpOrderRsyncQueueMapper.xml +++ b/ms-dal/src/main/resources/mapper/OpOrderRsyncQueueMapper.xml @@ -61,6 +61,14 @@ order by `gmt_modified` asc" limit 1 + delete from op_order_rsync_queue