wangchaoxu 1 year ago
commit 8f8d557b5c

@ -8,30 +8,9 @@ import java.util.List;
@Data
public class BatchAddPurchaseConfirmLogRequestDTO {
private String userId;
private String purchaseSource;
private String purchasePlatform;
@Data
public static class PlatformOrder implements Serializable {
private String platformOrderId;
private String userId;
private List<PlatformOrderItem> items;
}
@Data
public static class PlatformOrderItem implements Serializable {
private String platformOrderId;
private String platformItemId;
private String platformSkuId;
private Integer itemTotal;
private String platformSkuSubName;
private String sourceItemId;
private String sourceSkuId;
private Integer sourceNum;
private String sourceSkuPurchaseQuantity;
private String sourceSkuSubName;
private Integer isSkuSubNameEqual;
private Integer isItemTotalEqual;
private String dsRefundStatus;
}
private String platform;
private OperateInfoDTO operateInfo;
private List<PlatformOrderDTO> platformOrders;
}

@ -6,6 +6,7 @@ import java.util.List;
@Data
public class PlatformOrderDTO {
private String userId;
private String platformOrderId;
private Long shopId;
private ConsigneeInfoDTO consigneeInfo;

@ -6,7 +6,7 @@ import lombok.Data;
public class PlatformOrderItemDTO {
private String sourceItemId;
private String specId;
private Integer sourceSkuId;
private Long sourceSkuId;
private String platformItemId;
private String platformOrderId;
private Integer itemTotal;
@ -14,4 +14,5 @@ public class PlatformOrderItemDTO {
private Boolean isJxhyOffer;
private String instanceCode;
private String platformSkuSubName;
private String platformSkuId;
}

@ -4,7 +4,7 @@ import lombok.Data;
@Data
public class SavePlatformManualSelectedSkuRequestDTO {
private String shopId;
private String userId;
private String platform;
private String platformItemId;
private String platformSkuId;

@ -0,0 +1,10 @@
package com.ms.api.dto.dsapi.response;
import lombok.Data;
import java.util.HashMap;
@Data
public class BatchAddDsPurchaseConfirmLogResponseDTO extends CommonResponseDTO {
HashMap<String, Long> platformOrderIdAndPurchaseConfirmLogIdMap;
}

@ -10,7 +10,7 @@ import java.util.Map;
public class GetPurchaseOrderItemsAndSourceItemsResponseDTO extends CommonResponseDTO {
private Map<String, ProductInfo> sourceItemIdAndProductInfoMap;
private Map<String, CommonResponseDTO> sourceItemIdAndProductApiRetMap;
private Map<String, SourceItemSkuRelation> platformItemIdAndSourceItemSkuRelationMap;
private Map<String, Map<String, List<SourceItemSkuRelation>>> platformItemIdAndSourceItemSkuRelationMap;
private Map<String, List<PurchaseOrderItem>> platformOrderIdAndPurchaseOrderItemsMap;
private Map<String, List<PurchaseOrder>> platformOrderIdAndPurchaseOrdersMap;
private Map<String, SourceItemInfo> platformItemIdAndSourceItemInfoMap;
@ -32,6 +32,8 @@ public class GetPurchaseOrderItemsAndSourceItemsResponseDTO extends CommonRespon
private String resourceOwner;
private List<Sku> skus;
private EncryptLogisticsOrderSupportChannel encryptLogisticsOrderSupportChannel;
private Map<String, SourceItemSkuRelation> platformSkuIdAndSourceSkuInfoMap;
private Map<String, String> platformSkuIdAndSourceSkuIdMap;
}
@Data
@ -61,6 +63,7 @@ public class GetPurchaseOrderItemsAndSourceItemsResponseDTO extends CommonRespon
private String gmtCreate;
private String gmtModified;
private Long platformItemId;
private Long sourceItemId;
}
@Data

@ -0,0 +1,27 @@
package com.ms.api.consts;
public class QueueConst {
public static final String orderCareRsyncQueue = "order_care_rsync_queue";
public static final String orderFullRsyncQueue = "order_full_rsync_queue";
public static final String orderQuickRsyncQueue = "order_quick_rsync_queue";
public static final String wareQuickRsyncQueue = "ware_quick_rsync_queue";
public static final String wareFullRsyncQueue = "ware_full_rsync_queue";
public static final String crmMemberFullRsyncQueue = "crm_member_full_rsync_queue";
public static final String crmMemberQuickRsyncQueue = "crm_member_quick_rsync_queue";
public static final String titleKeywordRsyncQueue = "title_keyword_rsync_queue";
public static final String statusProcessing = "processing";
public static final String statusWait = "wait";
public static final String statusFinish = "finish";
public static final Integer maxMoveImportTaskQueueCount = 1000;
public static final Integer maxMoveImportTaskQueueCountSelf = 50;
public static String getQueueIdColumnName(String queueName) {
return queueName.concat("_id");
}
}

@ -1,5 +1,6 @@
package com.ms.api.service;
import java.util.HashMap;
import java.util.List;
import com.ms.api.dto.dsapi.request.BatchAddPurchaseConfirmLogRequestDTO;
@ -14,7 +15,7 @@ import com.ms.api.dto.dsorder.OrderItemDTO;
public interface DistributionOrderService {
BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(Long shopId, BatchCreateDistributionOrdersRequestDTO request);
GetPurchaseOrderItemsAndSourceItemsResponseDTO getSourceSkuInfos(Long shopId, List<OrderItemDTO> orderItems);
CommonResponseDTO batchAddDsPurchaseConfirmLog(BatchAddPurchaseConfirmLogRequestDTO request);
HashMap<String, Long> batchAddDsPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request);
void cancelPurchaseOrder(Long shopId, String orderId, List<Long> skuIds, String source, boolean isForce);
void closeSourceOrderAndCancelRelatePurchaseOrder(Long shopId, String orderId, String purchaseOrderSn);
String getDsPurchaseOrderPayUrl(Long shopId, GetDsPurchaseOrderPayUrlRequestDTO request);

@ -13,7 +13,7 @@ public interface DsApiService {
BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(BatchCreateDistributionOrdersRequestDTO request);
CommonResponseDTO saveDsManualSelectedSku(SavePlatformManualSelectedSkuRequestDTO request);
GetPurchaseOrderItemsAndSourceItemsResponseDTO getPurchaseOrderItemsAndSourceItems(GetPurchaseOrderItemsAndSourceItemsRequestDTO request);
CommonResponseDTO batchAddPurchaseConfirmLog(BatchAddPurchaseConfirmLogRequestDTO request);
BatchAddDsPurchaseConfirmLogResponseDTO batchAddPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request);
CommonResponseDTO cancelPurchaseOrderRelate(String platform, Long shopId, String orderId, List<Long> skuIds);
CommonResponseDTO cancelPurchaseOrder(String platform, Long shopId, String orderId, String purchaseOrderSn);
GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(List<String> sourceOrderId, Long shopId);

@ -23,9 +23,9 @@ public interface OpOrderChildService {
int updateByPrimaryKey(OpOrderChild record);
List<OpOrderChild> getListByOrderIdsAndSkuIds(List<String> orderIds, List<Integer> skuIds);
List<OpOrderChild> getListByOrderIdsAndSkuIds(List<String> orderIds, List<Long> skuIds);
HashMap<String, HashMap<Long, String>> getOrderIdAndSkuIdAndSkuSubNameMap(List<String> orderIds, List<Integer> skuIds);
HashMap<String, HashMap<Long, String>> getOrderIdAndSkuIdAndSkuSubNameMap(List<String> orderIds, List<Long> skuIds);
List<Integer> getHistorySkuIdsByOrderId(String orderId);

@ -1,5 +1,7 @@
package com.ms.api.service;
import java.util.List;
import com.ms.dal.entity.OpOrderRsyncQueue;
/**
@ -18,4 +20,6 @@ public interface OpOrderRsyncQueueService {
int updateByPrimaryKeySelective(OpOrderRsyncQueue record);
int updateByPrimaryKey(OpOrderRsyncQueue record);
OpOrderRsyncQueue lockSolidRedisQueue(Long timerLockId, boolean isAdminSelf);
}

@ -1,7 +1,10 @@
package com.ms.api.service;
import com.ms.dal.entity.OpPackage;
import com.ms.dal.entity.OpPackageOrderChild;
import java.util.List;
/**
*
*/
@ -18,4 +21,6 @@ public interface OpPackageOrderChildService {
int updateByPrimaryKeySelective(OpPackageOrderChild record);
int updateByPrimaryKey(OpPackageOrderChild record);
List<OpPackageOrderChild> getListByOpPackageIds(List<Long> opPackageIds);
}

@ -2,6 +2,8 @@ package com.ms.api.service;
import com.ms.dal.entity.OpPackageOrder;
import java.util.List;
/**
*
*/
@ -18,4 +20,8 @@ public interface OpPackageOrderService {
int updateByPrimaryKeySelective(OpPackageOrder record);
int updateByPrimaryKey(OpPackageOrder record);
List<Long> getOpPackageIdsByOrderIds(List<String> orderIds);
List<OpPackageOrder> getListByOrderIds(List<String> orderIds);
}

@ -2,6 +2,9 @@ package com.ms.api.service;
import com.ms.dal.entity.OpPackage;
import java.util.HashMap;
import java.util.List;
/**
*
*/
@ -18,4 +21,6 @@ public interface OpPackageService {
int updateByPrimaryKeySelective(OpPackage record);
int updateByPrimaryKey(OpPackage record);
List<OpPackage> getListByOpPackageIds(List<Long> opPackageIds);
}

@ -0,0 +1,21 @@
package com.ms.api.service;
import com.ms.dal.entity.PurchaseOrderCustom;
/**
*
*/
public interface PurchaseOrderCustomService {
int deleteByPrimaryKey(Long id);
int insert(PurchaseOrderCustom record);
int insertSelective(PurchaseOrderCustom record);
PurchaseOrderCustom selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PurchaseOrderCustom record);
int updateByPrimaryKey(PurchaseOrderCustom record);
}

@ -0,0 +1,21 @@
package com.ms.api.service;
import com.ms.dal.entity.PurchaseOrderDsEncrypt;
/**
*
*/
public interface PurchaseOrderDsEncryptService {
int deleteByPrimaryKey(Long id);
int insert(PurchaseOrderDsEncrypt record);
int insertSelective(PurchaseOrderDsEncrypt record);
PurchaseOrderDsEncrypt selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PurchaseOrderDsEncrypt record);
int updateByPrimaryKey(PurchaseOrderDsEncrypt record);
}

@ -0,0 +1,4 @@
package com.ms.api.service;
public interface QueueService {
}

@ -61,9 +61,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired
private OpOrderAmountDetailService opOrderAmountDetailService;
@Autowired
private OpOrderRedpackInfoService opOrderRedpackInfoService;
@Autowired
private PurchaseSettingService purchaseSettingService;
@ -88,6 +85,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired
private OpLogisticsPlatformService opLogisticsPlatformService;
@Autowired
private PurchaseOrderTagService purchaseOrderTagService;
@Override
public BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(Long shopId, BatchCreateDistributionOrdersRequestDTO request) {
@ -124,11 +123,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
platformOrderDto.setEncryptOutOrderInfo(encryptOutOrderInfoDto);
}
List<String> allDecryptFields = Arrays.asList("post_receiver", "post_tel", "detail");
Set<String> useManualConsigneeOrderIds = new HashSet<>();
HashMap<String, List<String>> tradeKeyAndDecryptFieldsMap = new HashMap<>();
HashMap<String, String> sourceItemIdAndSourceSellerIdMap = getSourceItemIdAndSourceSellerIdMap(request.getAllItems());
HashMap<String, String> rebuildPlatformOrdersByChoicesItem = new HashMap<>();
HashMap<Long, PlatformShopPurchaseSettingDTO> shopPurchaseSettings = new HashMap<>();
for (PlatformOrderDTO platformOrderDto : platformOrders) {
Set<String> sourceSellerIds = getSourceSellerIdsFromPlatformOrder(platformOrderDto, sourceItemIdAndSourceSellerIdMap);
@ -148,7 +144,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if (platformOrderDto.getConsigneeInfo().getIsManualInput()) {
useManualConsigneeOrderIds.add(platformOrderDto.getPlatformOrderId());
} else if (checkNeedDecryptConsigneeInfo(platformOrderDto, shopPurchaseSettings.get(platformOrderDto.getShopId()), sourceSellerIds.iterator().next())) {
tradeKeyAndDecryptFieldsMap.put(platformOrderDto.getPlatformOrderId(), allDecryptFields);
throw new RuntimeException("不支持解密");
}
for (PlatformOrderItemDTO item: platformOrderDto.getItems()) {
@ -325,19 +321,11 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
}
private void checkItems(List<PlatformOrderItemDTO> items) {
for (PlatformOrderItemDTO item: items) {
if (item.getSourceSkuId() == 0 || item.getItemTotal() == 0) {
throw new RuntimeException("items参数错误");
}
}
}
private List<PlatformOrderDTO> rebuildPlatformOrderItems(List<PlatformOrderDTO> platformOrders) {
private void rebuildPlatformOrderItems(List<PlatformOrderDTO> platformOrders) {
Stream<String> orderIdsStream = platformOrders.stream().map(PlatformOrderDTO::getPlatformOrderId);
List<String> orderIds = orderIdsStream.collect(Collectors.toList());
List<Integer> skuIds = new ArrayList<>();
List<Long> skuIds = new ArrayList<>();
for (PlatformOrderDTO platformOrder: platformOrders) {
for (PlatformOrderItemDTO item: platformOrder.getItems()) {
skuIds.add(item.getSourceSkuId());
@ -347,10 +335,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
HashMap<String, HashMap<Long, String>> orderIdAndSkuIdAndSkuSubNameMap = opOrderChildService.getOrderIdAndSkuIdAndSkuSubNameMap(orderIds, skuIds);
for (PlatformOrderDTO platformOrder: platformOrders) {
for (PlatformOrderItemDTO item: platformOrder.getItems()) {
item.setPlatformSkuSubName(orderIdAndSkuIdAndSkuSubNameMap.get(platformOrder.getPlatformOrderId()).get(Long.valueOf(item.getSourceSkuId())));
item.setPlatformSkuSubName(orderIdAndSkuIdAndSkuSubNameMap.get(platformOrder.getPlatformOrderId()).get(item.getSourceSkuId()));
}
}
return platformOrders;
}
private void dsRelatePurchaseOrder(PurchaseOrderRequestDTO purchaseOrderInfo, OpOrder opOrder) {
@ -472,8 +459,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
deliveryInfo.setWaybillCode(waybillCode);
}
for (PurchaseOrderItem item: purchaseOrder.getItems()) {
if (skuIds.contains(item.getSkuId().intValue())) {
List<OpOrderChild> childOrderInfoList = skuIdAndChildOrderInfoMap.get(item.getSkuId().intValue());
if (skuIds.contains(item.getSkuId())) {
List<OpOrderChild> childOrderInfoList = skuIdAndChildOrderInfoMap.get(item.getSkuId());
for (OpOrderChild child: childOrderInfoList) {
JSONObject opOrderChildAfterSale = child.getAfterSaleInfo();
if (opOrderChildAfterSale != null && opOrderChildAfterSale.get("after_sale_type").equals(AfterSaleConst.AFTERSALE_TYPE_REFUND_ONLY_BEFORE_SALE) && !AfterSaleConst.getAfterSaleCloseOrCancelStatusList().equals(opOrderChildAfterSale.get("after_sale_status"))) {
@ -487,7 +474,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
boolean hasMultiPackageOutstorage = opOrder.getOrderStatus().equals(OrderConst.ORDER_STATUS_PART_DELIVERY);
OrderPackageInfoDTO orderPackageInfoDTO = new OrderPackageInfoDTO();
orderPackageInfoDTO.setDeliveryInfo(deliveryInfo);;
orderPackageInfoDTO.setDeliveryInfo(deliveryInfo);
orderPackageInfoDTO.setPackageList(packageList);
orderPackageInfoDTO.setHasAfterSaleChildOrder(hasAfterSaleChildOrder);
orderPackageInfoDTO.setHasMultiPackageOutstorage(hasMultiPackageOutstorage);
@ -606,7 +593,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return newSellerWords;
}
newSellerWords = newSellerWords.replaceAll(appChineseName, "0.0");
if (newSellerWords.equals(oldSellerWords) && shopRemarkFlag.equals(opOrder.getSellerRemarkStars())) {
if (newSellerWords.equals(oldSellerWords) && String.valueOf(shopRemarkFlag).equals(opOrder.getSellerRemarkStars())) {
return newSellerWords;
}
opOrderExtService.updateOpOrderShopNote(shopId, orderId, newSellerWords);
@ -667,9 +654,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
String profitText = "";
String profitRatioText = "";
if (needProfit || needProfitRatio) {
HashMap<String, Double> resuslt = getOrderProfitAndRatioByOrderId(firstPurchaseOrder.getOrderId());
profitText = "(总利润 ¥" + resuslt.get("orderProfitSum") + "";
profitRatioText = "(利润率" + resuslt.get("orderTotalProfitRate") + "%";
HashMap<String, Double> result = getOrderProfitAndRatioByOrderId(firstPurchaseOrder.getOrderId());
profitText = "(总利润 ¥" + result.get("orderProfitSum") + "";
profitRatioText = "(利润率" + result.get("orderTotalProfitRate") + "%";
}
for (PurchaseOrder purchaseOrder: purchaseOrders) {
@ -813,9 +800,10 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
BigDecimal purchaseOrderPayment = new BigDecimal(purchaseOrderRequestDto.getPurchaseOrderPayment());
dbPurchaseOrder.setPurchaseOrderPayment(purchaseOrderPayment);
}
comparePurchaseOrderAndAddUpdateLog(purchaseOrderRequestDto, opOrder.getShopId(), PurchaseOrderConst.ACTION_RSYNC);
checkPurchaseOrderLogisticsChangeAndAddTag(purchaseOrderRequestDto, dbPurchaseOrder);
OpOrderExt orderExt = opOrderExtService.getByOrderId(dbPurchaseOrder.getOrderId());
if ("normal".equals(dbPurchaseOrder.getStatus()) && orderExt != null && orderExt.getFilterPurchaseStatus() != null) {
updateOpOrderFilterPurchaseStatus(opOrder.getOrderId(), orderExt);
}
@ -919,7 +907,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
List<PurchaseOrderItem> purchaseOrderItems = purchaseOrderItemService.getRelatedPurchaseOrderItems(opOrderDs.getShopId(), orderId);
List<String> purchaseWareIds;
List<Long> dsPurchaseSkuIds = new ArrayList<>();
List<String> dsPurchaseSkuIds = new ArrayList<>();
List<String> purchaseDsProductIds = new ArrayList<>();
if (!purchaseOrderItems.isEmpty()) {
Stream<String> wareIdsStream = purchaseOrderItems.stream().map(PurchaseOrderItem::getWareId);
@ -928,7 +916,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if (purchaseOrderItem.getPurchasePlatform().equals(purchasePlatform)) {
purchaseDsProductIds.add(purchaseOrderItem.getWareId());
dsProductIds.add(purchaseOrderItem.getWareId());
dsPurchaseSkuIds.add(purchaseOrderItem.getSkuId());
dsPurchaseSkuIds.add(String.valueOf(purchaseOrderItem.getSkuId()));
}
}
} else {
@ -938,7 +926,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
List<String> noPurchaseDsProductIds = dsProductIds.stream().filter(i -> !purchaseWareIds.contains(i)).collect(Collectors.toList());
List<String> notPurchaseDsSkuIds = dsProductIds.stream().filter(i -> !dsPurchaseSkuIds.contains(i)).collect(Collectors.toList());
List<Long> notDsAndDsPurchaseSkuIds = skuIdList.stream().filter(i -> !dsOrderSkuIds.contains(i)).collect(Collectors.toList());
notDsAndDsPurchaseSkuIds = notDsAndDsPurchaseSkuIds.stream().filter(i -> !dsPurchaseSkuIds.contains(i)).collect(Collectors.toList());
notDsAndDsPurchaseSkuIds = notDsAndDsPurchaseSkuIds.stream().filter(i -> !dsPurchaseSkuIds.contains(String.valueOf(i))).collect(Collectors.toList());
if (orderPrintService.checkAndDeleteOpOrderDs(purchasePlatform, orderId, productToDsItemList, purchaseOrderItems)) {
return;
@ -1020,11 +1008,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
opOrderDsService.updateByPrimaryKeySelective(opOrderDs);
}
private void addPurchaseOrderRefundOrderTipMsg(Long shopId, String orderId, String purchaseOrderStatus, Long purchaseOrderId) {
}
private void savePurchaseOrderInfo(PurchaseOrderRequestDTO purchaseOrderRequestDto, OpOrder opOrder, HashMap<Long, OpOrderChild> skuIdAndOpOrderChildMap) {
purchaseAccountService.savePurchaseAccount(opOrder.getShopId(), purchaseOrderRequestDto.getPurchasePlatform(), purchaseOrderRequestDto.getPurchaseOrderBuyer());
PurchaseOrder dbPurchaseOrder = purchaseOrderService.getByPlatformAndPurchaseOrderSn(purchaseOrderRequestDto.getPurchasePlatform(), purchaseOrderRequestDto.getPurchaseOrderSn());
@ -1150,10 +1133,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return log;
}
public void savePurchaseOrderSetting(Long shopId) {
}
private PurchaseOrder buildPurchaseOrderByDto(PurchaseOrderRequestDTO purchaseOrderRequestDto, PurchaseOrder oldPurchaseOrder, OpOrder opOrder) {
PurchaseOrder purchaseOrder = oldPurchaseOrder;
if (purchaseOrder == null) {
@ -1245,6 +1224,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return isReapt;
}
private void getOrderPurchaseItemsOldPackageInfo(PurchaseOrder purchaseOrder) {
List<PurchaseOrderItem> purchaseOrderItems = purchaseOrderItemService.getRelatePurchaseOrderItemsByPurchaseOrderId(purchaseOrder.getPurchaseOrderId());
List<Long> skuIds = purchaseOrderItems.stream().map(PurchaseOrderItem::getSkuId).collect(Collectors.toList());
List<String> orderIds = new ArrayList<>();
orderIds.add(purchaseOrder.getOrderId());
opOrderChildService.getListByOrderIdsAndSkuIds(orderIds, skuIds);
}
@Override
public GetPurchaseOrderItemsAndSourceItemsResponseDTO getSourceSkuInfos(Long shopId, List<OrderItemDTO> orderItems) {
Stream<String> orderIdsStream = orderItems.stream().map(OrderItemDTO::getOrderId);
@ -1256,7 +1244,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
Map<String, OpOrder> orderIdAndOpOrderMap = orders.stream().collect(Collectors.toMap(OpOrder::getOrderId, x->x));
Stream<Long> shopIdsStream = orders.stream().map(OpOrder::getShopId);
Set<Long> shopIdSet = shopIdsStream.collect(Collectors.toSet());
if (shopIdSet.size() != 1 || shopIdSet.contains(shopId)) {
if (shopIdSet.size() != 1 || !shopIdSet.contains(shopId)) {
throw new RuntimeException("订单归属异常");
}
@ -1283,8 +1271,12 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
@Override
public CommonResponseDTO batchAddDsPurchaseConfirmLog(BatchAddPurchaseConfirmLogRequestDTO request) {
return dsApiService.batchAddPurchaseConfirmLog(request);
public HashMap<String, Long> batchAddDsPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request) {
BatchAddDsPurchaseConfirmLogResponseDTO response = dsApiService.batchAddPurchaseConfirmLog(shopId, request);
if (!response.isSuccess()) {
throw new RuntimeException(response.getReason());
}
return response.getPlatformOrderIdAndPurchaseConfirmLogIdMap();
}
@Override

@ -47,9 +47,17 @@ public class DsApiServiceImpl implements DsApiService {
}
@Override
public CommonResponseDTO batchAddPurchaseConfirmLog(BatchAddPurchaseConfirmLogRequestDTO request) {
public BatchAddDsPurchaseConfirmLogResponseDTO batchAddPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request) {
request.setPlatform("dd");
request.setUserId(SecurityTool.encodeByAES(String.valueOf(shopId)));
request.setOperateInfo(createOperateInfo(shopId));
for (PlatformOrderDTO platformOrder: request.getPlatformOrders()) {
for (PlatformOrderItemDTO item: platformOrder.getItems()) {
item.setPlatformItemId(SecurityTool.encodeByAES(item.getPlatformItemId()));
}
}
String resp = execute("/order/batchAddPurchaseConfirmLog", objectToMap(request));
return JSON.parseObject(resp, CommonResponseDTO.class);
return JSON.parseObject(resp, BatchAddDsPurchaseConfirmLogResponseDTO.class);
}
@Override

@ -63,11 +63,11 @@ public class OpOrderChildServiceImpl implements OpOrderChildService{
}
@Override
public List<OpOrderChild> getListByOrderIdsAndSkuIds(List<String> orderIds, List<Integer> skuIds) {
public List<OpOrderChild> getListByOrderIdsAndSkuIds(List<String> orderIds, List<Long> skuIds) {
return opOrderChildMapper.getListByOrderIdsAndSkuIds(orderIds, skuIds);
}
@Override
public HashMap<String, HashMap<Long, String>> getOrderIdAndSkuIdAndSkuSubNameMap(List<String> orderIds, List<Integer> skuIds) {
public HashMap<String, HashMap<Long, String>> getOrderIdAndSkuIdAndSkuSubNameMap(List<String> orderIds, List<Long> skuIds) {
List<OpOrderChild> children = getListByOrderIdsAndSkuIds(orderIds, skuIds);
HashMap<String, HashMap<Long, String>> map = new HashMap<>();
for (OpOrderChild child: children) {

@ -1,20 +1,27 @@
package com.ms.api.service.impl;
import com.ms.dal.entity.OpOrderRsyncQueue;
import java.util.Date;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ms.api.consts.RedisKeyConst;
import com.ms.api.service.OpOrderRsyncQueueService;
import com.ms.dal.entity.OpOrderRsyncQueue;
import com.ms.dal.mapper.OpOrderRsyncQueueMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class OpOrderRsyncQueueServiceImpl implements OpOrderRsyncQueueService{
public class OpOrderRsyncQueueServiceImpl implements OpOrderRsyncQueueService {
@Autowired
private OpOrderRsyncQueueMapper opOrderRsyncQueueMapper;
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Override
public int deleteByPrimaryKey(Long id) {
@ -46,6 +53,30 @@ public class OpOrderRsyncQueueServiceImpl implements OpOrderRsyncQueueService{
return opOrderRsyncQueueMapper.updateByPrimaryKey(record);
}
@Override
public OpOrderRsyncQueue lockSolidRedisQueue(Long timerLockId, boolean isAdminSelf) {
String queueRedisKey = RedisKeyConst.getQueueRedisKey("op_order_rsync_queue", isAdminSelf);
String queueIdRedis = redisTemplate.opsForList().rightPop(queueRedisKey);
if (StrUtil.isBlank(queueIdRedis)) {
return null;
}
OpOrderRsyncQueue row = opOrderRsyncQueueMapper.queryFirstRowByQueueId(queueIdRedis);
if (ObjectUtil.isEmpty(row)) {
return null;
}
Date date = new Date();
row.setLocked(timerLockId);
row.setHostname("");
row.setGmtLastHeartbeat(date);
row.setGmtModified(date);
row.setGmtLocked(date);
int affectRows = opOrderRsyncQueueMapper.updateByPrimaryKey(row);
if (affectRows == 1) {
return row;
}
return null;
}
}

@ -6,6 +6,8 @@ import com.ms.dal.mapper.OpPackageOrderChildMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
@ -46,6 +48,10 @@ public class OpPackageOrderChildServiceImpl implements OpPackageOrderChildServic
return opPackageOrderChildMapper.updateByPrimaryKey(record);
}
@Override
public List<OpPackageOrderChild> getListByOpPackageIds(List<Long> opPackageIds) {
return opPackageOrderChildMapper.getListByOpPackageIds(opPackageIds);
}
}

@ -6,6 +6,9 @@ import com.ms.dal.mapper.OpPackageOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -46,6 +49,16 @@ public class OpPackageOrderServiceImpl implements OpPackageOrderService{
return opPackageOrderMapper.updateByPrimaryKey(record);
}
@Override
public List<Long> getOpPackageIdsByOrderIds(List<String> orderIds) {
List<OpPackageOrder> packageOrders = getListByOrderIds(orderIds);
return packageOrders.stream().map(OpPackageOrder::getOpPackageId).collect(Collectors.toList());
}
@Override
public List<OpPackageOrder> getListByOrderIds(List<String> orderIds) {
return opPackageOrderMapper.getListByOrderIds(orderIds);
}
}

@ -6,6 +6,8 @@ import com.ms.dal.mapper.OpPackageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
@ -46,6 +48,10 @@ public class OpPackageServiceImpl implements OpPackageService{
return opPackageMapper.updateByPrimaryKey(record);
}
@Override
public List<OpPackage> getListByOpPackageIds(List<Long> opPackageIds) {
return opPackageMapper.getListByOpPackageIds(opPackageIds);
}
}

@ -0,0 +1,53 @@
package com.ms.api.service.impl;
import com.ms.dal.entity.PurchaseOrderCustom;
import com.ms.api.service.PurchaseOrderCustomService;
import com.ms.dal.mapper.PurchaseOrderCustomMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class PurchaseOrderCustomServiceImpl implements PurchaseOrderCustomService{
@Autowired
private PurchaseOrderCustomMapper purchaseOrderCustomMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return purchaseOrderCustomMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(PurchaseOrderCustom record) {
return purchaseOrderCustomMapper.insert(record);
}
@Override
public int insertSelective(PurchaseOrderCustom record) {
return purchaseOrderCustomMapper.insertSelective(record);
}
@Override
public PurchaseOrderCustom selectByPrimaryKey(Long id) {
return purchaseOrderCustomMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(PurchaseOrderCustom record) {
return purchaseOrderCustomMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(PurchaseOrderCustom record) {
return purchaseOrderCustomMapper.updateByPrimaryKey(record);
}
}

@ -0,0 +1,53 @@
package com.ms.api.service.impl;
import com.ms.dal.entity.PurchaseOrderDsEncrypt;
import com.ms.api.service.PurchaseOrderDsEncryptService;
import com.ms.dal.mapper.PurchaseOrderDsEncryptMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class PurchaseOrderDsEncryptServiceImpl implements PurchaseOrderDsEncryptService{
@Autowired
private PurchaseOrderDsEncryptMapper purchaseOrderDsEncryptMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return purchaseOrderDsEncryptMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(PurchaseOrderDsEncrypt record) {
return purchaseOrderDsEncryptMapper.insert(record);
}
@Override
public int insertSelective(PurchaseOrderDsEncrypt record) {
return purchaseOrderDsEncryptMapper.insertSelective(record);
}
@Override
public PurchaseOrderDsEncrypt selectByPrimaryKey(Long id) {
return purchaseOrderDsEncryptMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(PurchaseOrderDsEncrypt record) {
return purchaseOrderDsEncryptMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(PurchaseOrderDsEncrypt record) {
return purchaseOrderDsEncryptMapper.updateByPrimaryKey(record);
}
}

@ -1751,13 +1751,13 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
String productId = opOrderChild.getProductId();
ProductToDsItem productToDsItem = productIdAndProductToDsItemMap.getOrDefault(productId, null);
if (ObjectUtil.isNotEmpty(productToDsItem)) {
if (PurchaseOrderConst.PURCHASE_PLATFORM_SOOXIE_D_S.equals(productToDsItem.getSource_platform())) {
if (PurchaseOrderConst.PURCHASE_PLATFORM_SOOXIE_D_S.equals(productToDsItem.getSourcePlatform())) {
productToDsItem.setSourceSellerId(null);
productToDsItem.setSource_platform(null);
productToDsItem.setSourcePlatform(null);
productToDsItem.setSourceItemId(null);
}
opOrderChild.setSourceSellerId(productToDsItem.getSourceSellerId());
opOrderChild.setSource_platform(productToDsItem.getSource_platform());
opOrderChild.setSource_platform(productToDsItem.getSourcePlatform());
opOrderChild.setSourceItemId(productToDsItem.getSourceItemId());
opOrderChild.setSourceItem(productToDsItem);
}

@ -0,0 +1,30 @@
package com.ms.api.service.impl;
import cn.hutool.core.util.StrUtil;
import com.ms.api.consts.QueueConst;
import com.ms.api.consts.RedisKeyConst;
import com.ms.api.service.QueueService;
import com.ms.dal.mapper.QueueMapper;
import lombok.AllArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class QueueServiceImpl implements QueueService {
private final RedisTemplate<String, String> redisTemplate;
private final QueueMapper queueMapper;
// public void lockSolidRedisQueue(Integer timerLockId, String queueName, boolean isAdminSelf) {
// String queueRedisKey = RedisKeyConst.getQueueRedisKey(queueName, isAdminSelf);
// String queueId = redisTemplate.opsForList().rightPop(queueRedisKey);
// if (StrUtil.isBlank(queueId)) {
// return;
// }
// String primaryColumn = QueueConst.getQueueIdColumnName(queueName);
// queueMapper.queryFirstRow("select * from %b where `locked` = 0 and %b = %i");
//
// }
}

@ -5,33 +5,40 @@ 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.SPIBaseService;
import com.ms.api.dto.move.GetCurrentShopMoveSettingRequestDTO;
import com.ms.api.service.MoveShopSettingService;
import com.ms.api.tool.DsJsonRequestTemplate;
import com.ms.dal.entity.MoveShopSetting;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
@ExtensionService("getCurrentShopMoveSetting")
@Slf4j
public class GetCurrentShopMoveSettingService extends SPIBaseService implements ExtensionServiceHandler<GetCurrentShopMoveSettingRequestDTO, Void> {
public class GetCurrentShopMoveSettingService extends SPIBaseService implements ExtensionServiceHandler<Void,Ret> {
@Autowired
private DsJsonRequestTemplate dsJsonRequestTemplate;
@Autowired
private MoveShopSettingService moveShopSettingService;
@Override
public BaseResponse<Void> handle(BaseRequest<GetCurrentShopMoveSettingRequestDTO> req) {
public BaseResponse<Ret> handle(BaseRequest<Void> req) {
initHandle(req);
// ----参数校验----
GetCurrentShopMoveSettingRequestDTO fields = req.getData();
// ----逻辑校验----
// ----业务处理----
MoveShopSetting moveShopSettings = moveShopSettingService.getDetailByShopId(shopId);
Map retData = new HashMap();
retData.put("detail", moveShopSettings);
return R.ok(Ret.success(retData));
// ----结果返回----
return R.ok();
}
}

@ -1,5 +1,6 @@
package com.ms.api.spi.move;
import cn.hutool.core.bean.BeanUtil;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService;
@ -7,10 +8,15 @@ import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
import com.ms.api.common.R;
import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.move.SaveCurrentShopMoveSettingRequestDTO;
import com.ms.api.service.MoveShopSettingService;
import com.ms.api.tool.DsJsonRequestTemplate;
import com.ms.dal.entity.MoveShopSetting;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
/**
*
*
@ -22,17 +28,40 @@ public class SaveCurrentShopMoveSettingService extends SPIBaseService implements
@Autowired
private DsJsonRequestTemplate dsJsonRequestTemplate;
@Autowired
private MoveShopSettingService moveShopSettingService;
@Override
public BaseResponse<Void> handle(BaseRequest<SaveCurrentShopMoveSettingRequestDTO> req) {
initHandle(req);
// ----参数校验----
SaveCurrentShopMoveSettingRequestDTO fields = req.getData();
SaveCurrentShopMoveSettingRequestDTO fields = req.getData();
// ----逻辑校验----
MoveShopSetting moveShopSettings = new MoveShopSetting();
moveShopSettings.setShopId(shopId);
moveShopSettings.setDeliveryDelayDay(fields.getDeliveryDelayDay());
moveShopSettings.setAliPriceType(fields.getAliPriceType());
moveShopSettings.setNoConsignPriceType(fields.getNoConsignPriceType());
if (fields.getPriceDecimalTypeRedio().equals("priceTail")) {
moveShopSettings.setPriceTail(fields.getPriceTail());
moveShopSettings.setPriceDecimal(null);
} else if (fields.getPriceDecimalTypeRedio().equals("priceDecimalType")) {
moveShopSettings.setPriceTail(0);
moveShopSettings.setPriceDecimal(fields.getPriceDecimalType());
}
moveShopSettings.setMoveOnsaleType(fields.getMoveOnsaleType());
moveShopSettings.setFreightTemplateId(fields.getFreightTemplateId());
moveShopSettings.setReduceType(fields.getReduceType());
moveShopSettings.setSupply7dayReturn(fields.getSupply7dayReturn());
// ----业务处理----
int moveShopConfigId = fields.getMoveShopConfigId();
if (moveShopConfigId == 0) {
moveShopSettingService.insertSelective(moveShopSettings);
} else {
moveShopSettings.setMoveShopSettingId(fields.getMoveShopConfigId());
moveShopSettingService.updateByPrimaryKeySelective(moveShopSettings);
}
// ----结果返回----
return R.ok();
}
}

@ -13,6 +13,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
@ExtensionService("batchAddDsPurchaseConfirmLog")
@Slf4j
@AllArgsConstructor
@ -22,9 +25,16 @@ public class BatchAddDsPurchaseConfirmLogService extends SPIBaseService implemen
@Override
public BaseResponse<Ret> handle(BaseRequest<BatchAddPurchaseConfirmLogRequestDTO> req) {
initHandle(req);
BatchAddPurchaseConfirmLogRequestDTO requestDTO = req.getData();
distributionOrderService.batchAddDsPurchaseConfirmLog(requestDTO);
return R.ok(Ret.success());
try {
initHandle(req);
BatchAddPurchaseConfirmLogRequestDTO requestDTO = req.getData();
HashMap<String, Long> platformOrderIdAndPurchaseConfirmLogIdMap = distributionOrderService.batchAddDsPurchaseConfirmLog(shopId, requestDTO);
Map<String, Object> data = new HashMap<>();
data.put("platformItemIdAndSourceItemInfoMap", platformOrderIdAndPurchaseConfirmLogIdMap);
return R.ok(Ret.success(data));
} catch (Exception e) {
log.error("batchAddDsPurchaseConfirmLog fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -8,11 +8,15 @@ import com.ms.api.common.R;
import com.ms.api.common.Ret;
import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.dsapi.request.BatchCreateDistributionOrdersRequestDTO;
import com.ms.api.dto.dsapi.response.BatchCreateDistributionOrdersResponseDTO;
import com.ms.api.service.DistributionOrderService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
@ExtensionService("batchCreateDistributionOrders")
@Slf4j
@AllArgsConstructor
@ -22,9 +26,19 @@ public class BatchCreateDistributionOrdersService extends SPIBaseService impleme
@Override
public BaseResponse<Ret> handle(BaseRequest<BatchCreateDistributionOrdersRequestDTO> req) {
initHandle(req);
BatchCreateDistributionOrdersRequestDTO requestDTO = req.getData();
distributionOrderService.batchCreateDistributionOrders(shopId, requestDTO);
return R.ok(Ret.success());
try {
initHandle(req);
BatchCreateDistributionOrdersRequestDTO requestDTO = req.getData();
BatchCreateDistributionOrdersResponseDTO response = distributionOrderService.batchCreateDistributionOrders(shopId, requestDTO);
Map<String, Object> data = new HashMap<>();
data.put("successCount", response.getSuccessCount());
data.put("failCount", response.getFailCount());
data.put("successList", response.getSuccessList());
data.put("errorList", response.getErrorList());
return R.ok(Ret.success(data));
} catch (Exception e) {
log.error("batchCreateDistributionOrders fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -23,10 +23,15 @@ public class CancelPurchaseOrderService extends SPIBaseService implements Extens
@Override
public BaseResponse<Ret> handle(BaseRequest<CanclePurchaseOrderRequestDTO> req) {
initHandle(req);
CanclePurchaseOrderRequestDTO requestDTO = req.getData();
String source = PurchaseOrderConst.PURCHASE_ORDER_CANCEL_SOURCE_CG_CANCEL;
distributionOrderService.cancelPurchaseOrder(shopId, requestDTO.getOrderId(), requestDTO.getSkuIds(), source, false);
return R.ok(Ret.success());
try {
initHandle(req);
CanclePurchaseOrderRequestDTO requestDTO = req.getData();
String source = PurchaseOrderConst.PURCHASE_ORDER_CANCEL_SOURCE_CG_CANCEL;
distributionOrderService.cancelPurchaseOrder(shopId, requestDTO.getOrderId(), requestDTO.getSkuIds(), source, false);
return R.ok(Ret.success());
} catch (Exception e) {
log.error("cancelPurchaseOrder fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -22,9 +22,14 @@ public class ClosePurchaseOrderService extends SPIBaseService implements Extensi
@Override
public BaseResponse<Ret> handle(BaseRequest<ClosePurchaseOrderRequestDTO> req) {
initHandle(req);
ClosePurchaseOrderRequestDTO requestDTO = req.getData();
distributionOrderService.closeSourceOrderAndCancelRelatePurchaseOrder(shopId, requestDTO.getOrderId(), requestDTO.getPurchaseOrderSn());
return R.ok(Ret.success());
try {
initHandle(req);
ClosePurchaseOrderRequestDTO requestDTO = req.getData();
distributionOrderService.closeSourceOrderAndCancelRelatePurchaseOrder(shopId, requestDTO.getOrderId(), requestDTO.getPurchaseOrderSn());
return R.ok(Ret.success());
} catch (Exception e) {
log.error("closePurchaseOrder fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -25,11 +25,16 @@ public class GetDsPurchaseOrderPayUrlService extends SPIBaseService implements E
@Override
public BaseResponse<Ret> handle(BaseRequest<GetDsPurchaseOrderPayUrlRequestDTO> req) {
initHandle(req);
GetDsPurchaseOrderPayUrlRequestDTO requestDTO = req.getData();
String payUrl = distributionOrderService.getDsPurchaseOrderPayUrl(shopId, requestDTO);
Map<String, Object> data = new HashMap<>();
data.put("payUrl", payUrl);
return R.ok(Ret.success(data));
try {
initHandle(req);
GetDsPurchaseOrderPayUrlRequestDTO requestDTO = req.getData();
String payUrl = distributionOrderService.getDsPurchaseOrderPayUrl(shopId, requestDTO);
Map<String, Object> data = new HashMap<>();
data.put("payUrl", payUrl);
return R.ok(Ret.success(data));
} catch (Exception e) {
log.error("getDsPurchaseOrderPayUrl fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -27,19 +27,24 @@ public class GetSourceSkuInfosService extends SPIBaseService implements Extensio
@Override
public BaseResponse<Ret> handle(BaseRequest<GetSourceSkuInfosRequestDTO> req) {
initHandle(req);
GetSourceSkuInfosRequestDTO requestDTO = req.getData();
GetPurchaseOrderItemsAndSourceItemsResponseDTO response = distributionOrderService.getSourceSkuInfos(shopId, requestDTO.getOrderItems());
if (!response.isSuccess()) {
throw new RuntimeException(response.getReason());
try {
initHandle(req);
GetSourceSkuInfosRequestDTO requestDTO = req.getData();
GetPurchaseOrderItemsAndSourceItemsResponseDTO response = distributionOrderService.getSourceSkuInfos(shopId, requestDTO.getOrderItems());
if (!response.isSuccess()) {
throw new RuntimeException(response.getReason());
}
Map<String, Object> data = new HashMap<>();
data.put("platformItemIdAndSourceItemInfoMap", response.getPlatformItemIdAndSourceItemInfoMap());
data.put("platformOrderIdAndPurchaseOrderItemsMap", response.getPlatformOrderIdAndPurchaseOrderItemsMap());
data.put("sourceItemIdAndProductInfoMap", response.getSourceItemIdAndProductInfoMap());
data.put("platformOrderIdAndPurchaseOrdersMap", response.getPlatformOrderIdAndPurchaseOrdersMap());
data.put("platformItemIdAndSourceItemSkuRelationMap", response.getPlatformItemIdAndSourceItemSkuRelationMap());
data.put("sourceItemIdAndProductApiRetMap", response.getSourceItemIdAndProductApiRetMap());
return R.ok(Ret.success(data));
} catch (Exception e) {
log.error("getSourceSkuInfos fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
Map<String, Object> data = new HashMap<>();
data.put("platformItemIdAndSourceItemInfoMap", response.getPlatformItemIdAndSourceItemInfoMap());
data.put("platformOrderIdAndPurchaseOrderItemsMap", response.getPlatformOrderIdAndPurchaseOrderItemsMap());
data.put("sourceItemIdAndProductInfoMap", response.getSourceItemIdAndProductInfoMap());
data.put("platformOrderIdAndPurchaseOrdersMap", response.getPlatformOrderIdAndPurchaseOrdersMap());
data.put("platformItemIdAndSourceItemSkuRelationMap", response.getPlatformItemIdAndSourceItemSkuRelationMap());
data.put("sourceItemIdAndProductApiRetMap", response.getSourceItemIdAndProductApiRetMap());
return R.ok(Ret.success(data));
}
}

@ -5,28 +5,41 @@ 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.SPIBaseService;
import com.ms.api.dto.dsapi.request.OperateInfoDTO;
import com.ms.api.dto.dsapi.request.SavePlatformManualSelectedSkuRequestDTO;
import com.ms.api.dto.dsapi.response.CommonResponseDTO;
import com.ms.api.service.DsApiService;
import com.ms.api.tool.SecurityTool;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ExtensionService("saveDsManualSelectedSku")
@Slf4j
public class SaveDsManualSelectedSkuService implements ExtensionServiceHandler<SavePlatformManualSelectedSkuRequestDTO, CommonResponseDTO> {
public class SaveDsManualSelectedSkuService extends SPIBaseService implements ExtensionServiceHandler<SavePlatformManualSelectedSkuRequestDTO, Ret> {
@Autowired
private DsApiService dsApiService;
@Override
public BaseResponse<CommonResponseDTO> handle(BaseRequest<SavePlatformManualSelectedSkuRequestDTO> req) {
String shopId = req.getAuthId();
SavePlatformManualSelectedSkuRequestDTO dto = req.getData();
dto.setShopId(shopId);
dto.setOperateInfo(new OperateInfoDTO(shopId));
dto.setPlatform("dd");
CommonResponseDTO responseDTO = dsApiService.saveDsManualSelectedSku(dto);
return R.ok(responseDTO);
public BaseResponse<Ret> handle(BaseRequest<SavePlatformManualSelectedSkuRequestDTO> req) {
try {
initHandle(req);
String shopId = SecurityTool.encodeByAES(req.getAuthId());
SavePlatformManualSelectedSkuRequestDTO dto = req.getData();
dto.setPlatformItemId(SecurityTool.encodeByAES(dto.getPlatformItemId()));
dto.setUserId(shopId);
dto.setOperateInfo(new OperateInfoDTO(shopId));
dto.setPlatform("dd");
CommonResponseDTO responseDTO = dsApiService.saveDsManualSelectedSku(dto);
if (!responseDTO.isSuccess()) {
throw new RuntimeException(responseDTO.getReason());
}
return R.ok(Ret.success());
} catch (Exception e) {
log.error("saveDsManualSelectedSku fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -0,0 +1,126 @@
package com.ms.api.task;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import cn.hutool.core.util.StrUtil;
import com.ms.api.common.StrObjMap;
import com.ms.api.common.TaskBaseService;
import com.ms.api.consts.RedisKeyConst;
import com.ms.api.service.MoveProductPublishQueueService;
import com.ms.api.service.OpOrderRsyncQueueService;
import com.ms.api.tool.CommonTool;
import com.ms.dal.entity.MoveProductPublishBuffer;
import com.ms.dal.entity.MoveProductPublishQueue;
import com.ms.dal.entity.MoveShopConfig;
import com.ms.dal.entity.OpOrderRsyncQueue;
import com.ms.dal.mapper.OpOrderRsyncQueueMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* move_product_publish_buffer
* move_product_publish_queue
*/
@Configuration
@Component
@Slf4j
public class RsyncOpTaskService extends TaskBaseService {
private static final String TASK_NAME = "RsyncOp";
@Autowired
private OpOrderRsyncQueueService opOrderRsyncQueueService;
/**
*
*/
@Override
public int getCorePoolSiz() {
return 3;
}
/**
*
*/
@Override
public String getTaskExecutorName() {
return "rsyncOpTaskPool";
}
@Bean(name = "rsyncOpTaskPool")
@Override
public Executor getAsyncExecutor() {
return super.getAsyncExecutor();
}
@Resource(name = "rsyncOpTaskPool")
protected Executor taskPool;
@Override
protected Executor getTaskPool() {
return taskPool;
}
@Override
public void runTask() {
super.runTask();
}
/**
*
*/
@Override
public Object getTask() {
return getBuffer(500);
}
/**
*
*
* @param params
* @return
*/
@Override
public Object processTask(Object params) {
Map<Long, Integer> selectMap = (Map<Long, Integer>) params;
log.info("start moveProductPublishBufferToQueue");
Map<Long, Integer> bufferCountMap = bufferToQueue(selectMap);
log.info("end moveProductPublishBufferToQueue ret: " + bufferCountMap.toString());
return bufferCountMap;
}
private Map<Long, Integer> bufferToQueue(Map<Long, Integer> selectMap) {
return new HashMap();
}
/**
*
*
* @param params
*/
@Override
public void clearTask(Object params) {
}
private Map<Long, Integer> getBuffer(int maxQueueCount) {
log.info("handle {}",TASK_NAME);
return new HashMap<>();
}
private void lockRsyncOpQueue(Long timerLockId){
opOrderRsyncQueueService.lockSolidRedisQueue(timerLockId,false);
}
}

@ -52,7 +52,7 @@ public class ProductToDsItem implements Serializable {
/**
*
*/
private String source_platform;
private String sourcePlatform;
/**
*

@ -0,0 +1,70 @@
package com.ms.dal.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName purchase_order_custom
*/
@Data
public class PurchaseOrderCustom implements Serializable {
/**
*
*/
private Long purchaseOrderCustomId;
/**
*
*/
private Long purchaseOrderId;
/**
*
*/
private Long shopId;
/**
*
*/
private BigDecimal customPurchaseOrderPayment;
/**
*
*/
private String customPurchaseOrderBuyer;
/**
*
*/
private String customPurchaseOrderSeller;
/**
*
*/
private Long operateShopId;
/**
*
*/
private String operateIp;
/**
*
*/
private String lastPayFailReason;
/**
*
*/
private Date gmtCreate;
/**
*
*/
private Date gmtModified;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,64 @@
package com.ms.dal.entity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName purchase_order_ds_encrypt
*/
@Data
public class PurchaseOrderDsEncrypt implements Serializable {
/**
*
*/
private Long purchaseOrderDsEncryptId;
/**
*
*/
private Long shopId;
/**
*
*/
private String orderId;
/**
*
*/
private String purchaseOrderSn;
/**
*
*/
private Boolean isSupportEncryptOrder;
/**
*
*/
private Byte isEncryptOrder;
/**
*
*/
private String result;
/**
*
*/
private String reason;
/**
*
*/
private Date gmtCreate;
/**
*
*/
private Date gmtModified;
private static final long serialVersionUID = 1L;
}

@ -27,7 +27,7 @@ public interface OpOrderChildMapper {
int updateByPrimaryKey(OpOrderChild record);
List<OpOrderChild> getListByOrderIdsAndSkuIds(@Param("orderIds") List<String> orderIds, @Param("skuIds") List<Integer> skuIds);
List<OpOrderChild> getListByOrderIdsAndSkuIds(@Param("orderIds") List<String> orderIds, @Param("skuIds") List<Long> skuIds);
List<OpOrderChild> getListByOrderId(@Param("orderId") String orderId);

@ -27,4 +27,6 @@ public interface OpOrderRsyncQueueMapper {
List<OpOrderRsyncQueue> getByShopId(@Param("shopIds") List<String> shopid);
int insertUpdate(OpOrderRsyncQueue queueInfo);
OpOrderRsyncQueue queryFirstRowByQueueId(@Param("queueId") String queueId);
}

@ -3,6 +3,8 @@ package com.ms.dal.mapper;
import com.ms.dal.entity.OpPackage;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Entity com.ms.dal.entity.OpPackage
*/
@ -23,4 +25,5 @@ public interface OpPackageMapper {
int updateByPrimaryKey(OpPackage record);
List<OpPackage> getListByOpPackageIds(List<Long> opPackageIds);
}

@ -3,6 +3,8 @@ package com.ms.dal.mapper;
import com.ms.dal.entity.OpPackageOrderChild;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Entity com.ms.dal.entity.OpPackageOrderChild
*/
@ -23,4 +25,5 @@ public interface OpPackageOrderChildMapper {
int updateByPrimaryKey(OpPackageOrderChild record);
List<OpPackageOrderChild> getListByOpPackageIds(List<Long> opPackageIds);
}

@ -3,6 +3,8 @@ package com.ms.dal.mapper;
import com.ms.dal.entity.OpPackageOrder;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Entity com.ms.dal.entity.OpPackageOrder
*/
@ -23,4 +25,5 @@ public interface OpPackageOrderMapper {
int updateByPrimaryKey(OpPackageOrder record);
List<OpPackageOrder> getListByOrderIds(List<String> orderIds);
}

@ -0,0 +1,26 @@
package com.ms.dal.mapper;
import com.ms.dal.entity.PurchaseOrderCustom;
import org.apache.ibatis.annotations.Mapper;
/**
* @Entity com.ms.dal.entity.PurchaseOrderCustom
*/
@Mapper
public interface PurchaseOrderCustomMapper {
int deleteByPrimaryKey(Long id);
int insert(PurchaseOrderCustom record);
int insertOrUpdate(PurchaseOrderCustom record);
int insertSelective(PurchaseOrderCustom record);
PurchaseOrderCustom selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PurchaseOrderCustom record);
int updateByPrimaryKey(PurchaseOrderCustom record);
}

@ -0,0 +1,26 @@
package com.ms.dal.mapper;
import com.ms.dal.entity.PurchaseOrderDsEncrypt;
import org.apache.ibatis.annotations.Mapper;
/**
* @Entity com.ms.dal.entity.PurchaseOrderDsEncrypt
*/
@Mapper
public interface PurchaseOrderDsEncryptMapper {
int deleteByPrimaryKey(Long id);
int insert(PurchaseOrderDsEncrypt record);
int insertOrUpdate(PurchaseOrderDsEncrypt record);
int insertSelective(PurchaseOrderDsEncrypt record);
PurchaseOrderDsEncrypt selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PurchaseOrderDsEncrypt record);
int updateByPrimaryKey(PurchaseOrderDsEncrypt record);
}

@ -0,0 +1,8 @@
package com.ms.dal.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface QueueMapper {
}

@ -51,6 +51,9 @@
</foreach>
</if>
</select>
<select id="queryFirstRowByQueueId" resultType="com.ms.dal.entity.OpOrderRsyncQueue">
select * from op_order_rsync_queue where `locked` = 0 and op_order_rsync_queue_id = #{queueId}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_order_rsync_queue

@ -38,7 +38,23 @@
from op_package
where op_package_id = #{opPackageId,jdbcType=BIGINT}
</select>
<select id="getListByOpPackageIds" resultType="com.ms.dal.entity.OpPackage">
select
<include refid="Base_Column_List" />
from op_package
where 1=1
<choose>
<when test="opPackageIds!=null and opPackageIds.size>0">
and op_package_id IN %ls'
<foreach collection="opPackageIds" item="wareId" index="index" open="(" close=")" separator=",">
#{wareId}
</foreach>
</when>
<otherwise>
AND 1=0
</otherwise>
</choose>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_package
where op_package_id = #{opPackageId,jdbcType=BIGINT}

@ -27,7 +27,23 @@
from op_package_order_child
where op_package_order_child_id = #{opPackageOrderChildId,jdbcType=BIGINT}
</select>
<select id="getListByOpPackageIds" resultType="com.ms.dal.entity.OpPackageOrderChild">
select
<include refid="Base_Column_List" />
from op_package
where 1=1
<choose>
<when test="opPackageIds!=null and opPackageIds.size>0">
and op_package_id IN %ls'
<foreach collection="opPackageIds" item="wareId" index="index" open="(" close=")" separator=",">
#{wareId}
</foreach>
</when>
<otherwise>
AND 1=0
</otherwise>
</choose>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_package_order_child
where op_package_order_child_id = #{opPackageOrderChildId,jdbcType=BIGINT}

@ -24,6 +24,23 @@
from op_package_order
where op_package_order_id = #{opPackageOrderId,jdbcType=BIGINT}
</select>
<select id="getListByOrderIds" resultType="com.ms.dal.entity.OpPackageOrder">
select
<include refid="Base_Column_List" />
from op_package_order
where 1=1
<choose>
<when test="orderIds!=null and orderIds.size>0">
and order_id IN %ls'
<foreach collection="orderIds" item="wareId" index="index" open="(" close=")" separator=",">
#{wareId}
</foreach>
</when>
<otherwise>
AND 1=0
</otherwise>
</choose>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_package_order

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ms.dal.mapper.PurchaseOrderCustomMapper">
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrderCustom">
<id property="purchaseOrderCustomId" column="purchase_order_custom_id" jdbcType="BIGINT"/>
<result property="purchaseOrderId" column="purchase_order_id" jdbcType="BIGINT"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="customPurchaseOrderPayment" column="custom_purchase_order_payment" jdbcType="DECIMAL"/>
<result property="customPurchaseOrderBuyer" column="custom_purchase_order_buyer" jdbcType="VARCHAR"/>
<result property="customPurchaseOrderSeller" column="custom_purchase_order_seller" jdbcType="VARCHAR"/>
<result property="operateShopId" column="operate_shop_id" jdbcType="BIGINT"/>
<result property="operateIp" column="operate_ip" jdbcType="VARCHAR"/>
<result property="lastPayFailReason" column="last_pay_fail_reason" jdbcType="VARCHAR"/>
<result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/>
<result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
purchase_order_custom_id,purchase_order_id,shop_id,
custom_purchase_order_payment,custom_purchase_order_buyer,custom_purchase_order_seller,
operate_shop_id,operate_ip,last_pay_fail_reason,
gmt_create,gmt_modified
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from purchase_order_custom
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_order_custom
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="purchase_order_custom_id" keyProperty="purchaseOrderCustomId" parameterType="com.ms.dal.entity.PurchaseOrderCustom" useGeneratedKeys="true">
insert into purchase_order_custom
( purchase_order_custom_id,purchase_order_id,shop_id
,custom_purchase_order_payment,custom_purchase_order_buyer,custom_purchase_order_seller
,operate_shop_id,operate_ip,last_pay_fail_reason
,gmt_create,gmt_modified)
values (#{purchaseOrderCustomId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT}
,#{customPurchaseOrderPayment,jdbcType=DECIMAL},#{customPurchaseOrderBuyer,jdbcType=VARCHAR},#{customPurchaseOrderSeller,jdbcType=VARCHAR}
,#{operateShopId,jdbcType=BIGINT},#{operateIp,jdbcType=VARCHAR},#{lastPayFailReason,jdbcType=VARCHAR}
,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP})
</insert>
<update id="insertOrUpdate" keyColumn="purchase_order_custom_id" keyProperty="purchaseOrderCustomId" parameterType="com.ms.dal.entity.PurchaseOrderCustom"
useGeneratedKeys="true">
insert into purchase_order_custom
( purchase_order_custom_id,purchase_order_id,shop_id
,custom_purchase_order_payment,custom_purchase_order_buyer,custom_purchase_order_seller
,operate_shop_id,operate_ip,last_pay_fail_reason
,gmt_create,gmt_modified)
values (#{purchaseOrderCustomId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT}
,#{customPurchaseOrderPayment,jdbcType=DECIMAL},#{customPurchaseOrderBuyer,jdbcType=VARCHAR},#{customPurchaseOrderSeller,jdbcType=VARCHAR}
,#{operateShopId,jdbcType=BIGINT},#{operateIp,jdbcType=VARCHAR},#{lastPayFailReason,jdbcType=VARCHAR}
,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP})
ON DUPLICATE KEY UPDATE
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT}, shop_id = #{shopId,jdbcType=BIGINT}, custom_purchase_order_payment = #{customPurchaseOrderPayment,jdbcType=DECIMAL}, custom_purchase_order_buyer = #{customPurchaseOrderBuyer,jdbcType=VARCHAR}, custom_purchase_order_seller = #{customPurchaseOrderSeller,jdbcType=VARCHAR}, operate_shop_id = #{operateShopId,jdbcType=BIGINT}, operate_ip = #{operateIp,jdbcType=VARCHAR}, last_pay_fail_reason = #{lastPayFailReason,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
</update>
<insert id="insertSelective" keyColumn="purchase_order_custom_id" keyProperty="purchaseOrderCustomId" parameterType="com.ms.dal.entity.PurchaseOrderCustom" useGeneratedKeys="true">
insert into purchase_order_custom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCustomId != null">purchase_order_custom_id,</if>
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="customPurchaseOrderPayment != null">custom_purchase_order_payment,</if>
<if test="customPurchaseOrderBuyer != null">custom_purchase_order_buyer,</if>
<if test="customPurchaseOrderSeller != null">custom_purchase_order_seller,</if>
<if test="operateShopId != null">operate_shop_id,</if>
<if test="operateIp != null">operate_ip,</if>
<if test="lastPayFailReason != null">last_pay_fail_reason,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCustomId != null">#{purchaseOrderCustomId,jdbcType=BIGINT},</if>
<if test="purchaseOrderId != null">#{purchaseOrderId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="customPurchaseOrderPayment != null">#{customPurchaseOrderPayment,jdbcType=DECIMAL},</if>
<if test="customPurchaseOrderBuyer != null">#{customPurchaseOrderBuyer,jdbcType=VARCHAR},</if>
<if test="customPurchaseOrderSeller != null">#{customPurchaseOrderSeller,jdbcType=VARCHAR},</if>
<if test="operateShopId != null">#{operateShopId,jdbcType=BIGINT},</if>
<if test="operateIp != null">#{operateIp,jdbcType=VARCHAR},</if>
<if test="lastPayFailReason != null">#{lastPayFailReason,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseOrderCustom">
update purchase_order_custom
<set>
<if test="purchaseOrderId != null">
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="customPurchaseOrderPayment != null">
custom_purchase_order_payment = #{customPurchaseOrderPayment,jdbcType=DECIMAL},
</if>
<if test="customPurchaseOrderBuyer != null">
custom_purchase_order_buyer = #{customPurchaseOrderBuyer,jdbcType=VARCHAR},
</if>
<if test="customPurchaseOrderSeller != null">
custom_purchase_order_seller = #{customPurchaseOrderSeller,jdbcType=VARCHAR},
</if>
<if test="operateShopId != null">
operate_shop_id = #{operateShopId,jdbcType=BIGINT},
</if>
<if test="operateIp != null">
operate_ip = #{operateIp,jdbcType=VARCHAR},
</if>
<if test="lastPayFailReason != null">
last_pay_fail_reason = #{lastPayFailReason,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseOrderCustom">
update purchase_order_custom
set
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
shop_id = #{shopId,jdbcType=BIGINT},
custom_purchase_order_payment = #{customPurchaseOrderPayment,jdbcType=DECIMAL},
custom_purchase_order_buyer = #{customPurchaseOrderBuyer,jdbcType=VARCHAR},
custom_purchase_order_seller = #{customPurchaseOrderSeller,jdbcType=VARCHAR},
operate_shop_id = #{operateShopId,jdbcType=BIGINT},
operate_ip = #{operateIp,jdbcType=VARCHAR},
last_pay_fail_reason = #{lastPayFailReason,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
</update>
</mapper>

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ms.dal.mapper.PurchaseOrderDsEncryptMapper">
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrderDsEncrypt">
<id property="purchaseOrderDsEncryptId" column="purchase_order_ds_encrypt_id" jdbcType="BIGINT"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
<result property="purchaseOrderSn" column="purchase_order_sn" jdbcType="VARCHAR"/>
<result property="isSupportEncryptOrder" column="is_support_encrypt_order" jdbcType="BOOLEAN"/>
<result property="isEncryptOrder" column="is_encrypt_order" jdbcType="TINYINT"/>
<result property="result" column="result" jdbcType="VARCHAR"/>
<result property="reason" column="reason" jdbcType="VARCHAR"/>
<result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/>
<result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
purchase_order_ds_encrypt_id,shop_id,order_id,
purchase_order_sn,is_support_encrypt_order,is_encrypt_order,
result,reason,gmt_create,
gmt_modified
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from purchase_order_ds_encrypt
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_order_ds_encrypt
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="purchase_order_ds_encrypt_id" keyProperty="purchaseOrderDsEncryptId" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt" useGeneratedKeys="true">
insert into purchase_order_ds_encrypt
( purchase_order_ds_encrypt_id,shop_id,order_id
,purchase_order_sn,is_support_encrypt_order,is_encrypt_order
,result,reason,gmt_create
,gmt_modified)
values (#{purchaseOrderDsEncryptId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR}
,#{purchaseOrderSn,jdbcType=VARCHAR},#{isSupportEncryptOrder,jdbcType=BOOLEAN},#{isEncryptOrder,jdbcType=TINYINT}
,#{result,jdbcType=VARCHAR},#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP}
,#{gmtModified,jdbcType=TIMESTAMP})
</insert>
<update id="insertOrUpdate" keyColumn="purchase_order_ds_encrypt_id" keyProperty="purchaseOrderDsEncryptId" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt"
useGeneratedKeys="true">
insert into purchase_order_ds_encrypt
( purchase_order_ds_encrypt_id,shop_id,order_id
,purchase_order_sn,is_support_encrypt_order,is_encrypt_order
,result,reason,gmt_create
,gmt_modified)
values (#{purchaseOrderDsEncryptId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR}
,#{purchaseOrderSn,jdbcType=VARCHAR},#{isSupportEncryptOrder,jdbcType=BOOLEAN},#{isEncryptOrder,jdbcType=TINYINT}
,#{result,jdbcType=VARCHAR},#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP}
,#{gmtModified,jdbcType=TIMESTAMP})
ON DUPLICATE KEY UPDATE
shop_id = #{shopId,jdbcType=BIGINT}, order_id = #{orderId,jdbcType=VARCHAR}, purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR}, is_support_encrypt_order = #{isSupportEncryptOrder,jdbcType=BOOLEAN}, is_encrypt_order = #{isEncryptOrder,jdbcType=TINYINT}, result = #{result,jdbcType=VARCHAR}, reason = #{reason,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
</update>
<insert id="insertSelective" keyColumn="purchase_order_ds_encrypt_id" keyProperty="purchaseOrderDsEncryptId" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt" useGeneratedKeys="true">
insert into purchase_order_ds_encrypt
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderDsEncryptId != null">purchase_order_ds_encrypt_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="orderId != null">order_id,</if>
<if test="purchaseOrderSn != null">purchase_order_sn,</if>
<if test="isSupportEncryptOrder != null">is_support_encrypt_order,</if>
<if test="isEncryptOrder != null">is_encrypt_order,</if>
<if test="result != null">result,</if>
<if test="reason != null">reason,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderDsEncryptId != null">#{purchaseOrderDsEncryptId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
<if test="purchaseOrderSn != null">#{purchaseOrderSn,jdbcType=VARCHAR},</if>
<if test="isSupportEncryptOrder != null">#{isSupportEncryptOrder,jdbcType=BOOLEAN},</if>
<if test="isEncryptOrder != null">#{isEncryptOrder,jdbcType=TINYINT},</if>
<if test="result != null">#{result,jdbcType=VARCHAR},</if>
<if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt">
update purchase_order_ds_encrypt
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="purchaseOrderSn != null">
purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR},
</if>
<if test="isSupportEncryptOrder != null">
is_support_encrypt_order = #{isSupportEncryptOrder,jdbcType=BOOLEAN},
</if>
<if test="isEncryptOrder != null">
is_encrypt_order = #{isEncryptOrder,jdbcType=TINYINT},
</if>
<if test="result != null">
result = #{result,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt">
update purchase_order_ds_encrypt
set
shop_id = #{shopId,jdbcType=BIGINT},
order_id = #{orderId,jdbcType=VARCHAR},
purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR},
is_support_encrypt_order = #{isSupportEncryptOrder,jdbcType=BOOLEAN},
is_encrypt_order = #{isEncryptOrder,jdbcType=TINYINT},
result = #{result,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
</update>
</mapper>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ms.dal.mapper.QueueMapper">
</mapper>

@ -6,6 +6,7 @@ import java.util.Map;
import javax.annotation.Resource;
import com.alibaba.fastjson.JSONObject;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.ms.api.common.ApiResult;
import com.ms.api.common.Pager;
@ -14,11 +15,14 @@ import com.ms.api.common.Ret;
import com.ms.api.consts.AppConst;
import com.ms.api.consts.DsOrderConst;
import com.ms.api.consts.PurchaseOrderConst;
import com.ms.api.dto.dsapi.response.GetPurchaseOrderItemsAndSourceItemsResponseDTO;
import com.ms.api.dto.dsorder.GetSourceSkuInfosRequestDTO;
import com.ms.api.dto.order.ManualRsyncDdOrdersDTO;
import com.ms.api.dto.order.RsyncAfterSaleRequestDTO;
import com.ms.api.dto.order.RsyncFullOrderRequestDTO;
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
import com.ms.api.service.DistributionOrderService;
import com.ms.api.service.OpOrderService;
import com.ms.api.service.PurchaseOrderService;
import com.ms.api.util.OrderUtil;
@ -56,6 +60,9 @@ public class OrderTestController {
@Resource
private OpOrderService opOrderService;
@Resource
private DistributionOrderService distributionOrderService;
@PostMapping("/searchDsOrderList")
public BaseResponse<Ret> searchDsOrderList(@RequestBody SearchDsOrderListRequestDTO dto) {
String shopId = AppConst.TEST_SHOP_ID;

Loading…
Cancel
Save