Merge remote-tracking branch 'origin/master'

20230922-ljl-fixBug
qiushengjie 1 year ago
commit b5d9810964

@ -21,5 +21,5 @@ public class ConsigneeInfoDTO {
private String fullAddress;
private Boolean hasHide = true;
private List<String> hasDecryptFields;
private Boolean isManualInput;
private Boolean isManualInput = false;
}

@ -8,7 +8,7 @@ import java.util.List;
public class PlatformOrderDTO {
private String userId;
private String platformOrderId;
private Long shopId;
private String shopId;
private ConsigneeInfoDTO consigneeInfo;
private String buyerRemark;
private EncryptOutOrderInfoDTO encryptOutOrderInfo;

@ -14,5 +14,5 @@ public class PlatformOrderItemDTO {
private Boolean isJxhyOffer;
private String instanceCode;
private String platformSkuSubName;
private String platformSkuId;
private Long platformSkuId;
}

@ -4,6 +4,7 @@ import com.ms.api.dto.dsorder.PurchaseOrderRequestDTO;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
@Data
public class DsSuccessRetDTO {private String platformOrderId;
@ -17,5 +18,5 @@ public class DsSuccessRetDTO {private String platformOrderId;
private String flow;
private Boolean includeSplitJxhy;
private HashMap<String, DsPayRetDTO> dsPayRet;
private HashMap<String, PurchaseOrderRequestDTO> relatePurchaseOrderInfos;
private List<PurchaseOrderRequestDTO> relatePurchaseOrderInfos;
}

@ -5,7 +5,7 @@ import lombok.Data;
@Data
public class PurchaseOrderItemRequestDTO {
private Long skuId;
private Integer wareId;
private Long wareId;
private Integer purchaseNum;
private Double purchasePrice;
private String purchaseUrl;

@ -31,7 +31,7 @@ public class PurchaseOrderRequestDTO {
private String checkStatus;
private Integer logisticsIsAccept;
private String purchaseOrderSendTime;
private Boolean isFirstPurchase;
private Boolean isFirstPurchase = false;
private String purchaseAlipayMerchantNo;
public List<Long> getSkuIds() {

@ -10,7 +10,7 @@ import java.util.List;
public interface DsApiService {
GetPlatformShopPurchaseSettingResponseDTO getPlatformShopPurchaseSetting(String userId, String platform);
BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(BatchCreateDistributionOrdersRequestDTO request);
BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(Long shopId, BatchCreateDistributionOrdersRequestDTO request);
CommonResponseDTO saveDsManualSelectedSku(SavePlatformManualSelectedSkuRequestDTO request);
GetPurchaseOrderItemsAndSourceItemsResponseDTO getPurchaseOrderItemsAndSourceItems(GetPurchaseOrderItemsAndSourceItemsRequestDTO request);
BatchAddDsPurchaseConfirmLogResponseDTO batchAddPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request);

@ -27,7 +27,7 @@ public interface OpOrderChildService {
HashMap<String, HashMap<Long, String>> getOrderIdAndSkuIdAndSkuSubNameMap(List<String> orderIds, List<Long> skuIds);
List<Integer> getHistorySkuIdsByOrderId(String orderId);
List<Long> getHistorySkuIdsByOrderId(String orderId);
List<OpOrderChild> getListByOrderId(String orderId);
@ -36,4 +36,6 @@ public interface OpOrderChildService {
Map<String, List<OpOrderChild>> getOrderIdAndChildrenMapByOrderIds(List<String> orderIds);
List<OpOrderChild> getChildrenByOrderId(String orderId);
List<Long> getSkuIdsByOrderId(String orderId);
}

@ -23,7 +23,7 @@ public interface PurchaseOrderItemService {
int updateByPrimaryKey(PurchaseOrderItem record);
List<Integer> getSkuIdsByOrderId(String orderId);
List<Long> getSkuIdsByOrderId(String orderId);
List<PurchaseOrderItem> getRelatedPurchaseOrderItems(Long shopId, String orderId);

@ -105,6 +105,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
orderIdAndOpOrderMap.put(opOrder.getOrderId(), opOrder);
}
System.out.println("orderIdAndOpOrderMap" + orderIdAndOpOrderMap);
Stream<Long> shopIdsStream = orderIdAndOpOrderMap.values().stream().map(OpOrder::getShopId);
Set<Long> shopIds = shopIdsStream.collect(Collectors.toSet());
if (shopIds.size() != 1 || !shopIds.contains(shopId)) {
@ -135,15 +137,16 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
throw new RuntimeException("购买的商品不属于同一个卖家,请检查后重新提交!");
}
if (!shopPurchaseSettings.containsKey(platformOrderDto.getShopId())) {
if (!shopPurchaseSettings.containsKey(Long.valueOf(platformOrderDto.getShopId()))) {
GetPlatformShopPurchaseSettingResponseDTO resp = dsApiService.getPlatformShopPurchaseSetting(String.valueOf(platformOrderDto.getShopId()), "dd");
shopPurchaseSettings.put(platformOrderDto.getShopId(), resp.getPurchaseSetting());
shopPurchaseSettings.put(Long.valueOf(platformOrderDto.getShopId()), resp.getPurchaseSetting());
}
checkConsigneeInfo(platformOrderDto.getConsigneeInfo());
System.out.println("getConsigneeInfo" + platformOrderDto.getConsigneeInfo());
if (platformOrderDto.getConsigneeInfo().getIsManualInput()) {
useManualConsigneeOrderIds.add(platformOrderDto.getPlatformOrderId());
} else if (checkNeedDecryptConsigneeInfo(platformOrderDto, shopPurchaseSettings.get(platformOrderDto.getShopId()), sourceSellerIds.iterator().next())) {
} else if (checkNeedDecryptConsigneeInfo(platformOrderDto, shopPurchaseSettings.get(Long.valueOf(platformOrderDto.getShopId())), sourceSellerIds.iterator().next())) {
throw new RuntimeException("不支持解密");
}
@ -159,17 +162,23 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
rebuildPlatformOrderItems(platformOrders);
request.setPlatformOrders(platformOrders);
BatchCreateDistributionOrdersResponseDTO dsResponse = dsApiService.batchCreateDistributionOrders(request);
BatchCreateDistributionOrdersResponseDTO dsResponse = dsApiService.batchCreateDistributionOrders(shopId, request);
if (!dsResponse.isSuccess()) {
throw new RuntimeException(dsResponse.getReason());
}
for (DsSuccessRetDTO successRet: dsResponse.getSuccessList()) {
HashMap<String, PurchaseOrderRequestDTO> relatePurchaseOrderInfos = successRet.getRelatePurchaseOrderInfos();
List<PurchaseOrderRequestDTO> relatePurchaseOrderInfos = successRet.getRelatePurchaseOrderInfos();
boolean isUseManualConsignee = useManualConsigneeOrderIds.contains(successRet.getPlatformOrderId());
for (Map.Entry<String, PurchaseOrderRequestDTO> entry: relatePurchaseOrderInfos.entrySet()) {
for (PurchaseOrderRequestDTO purchaseOrder: relatePurchaseOrderInfos) {
if (isUseManualConsignee) {
entry.getValue().setIsUseManualConsignee(true);
purchaseOrder.setIsUseManualConsignee(true);
}
dsRelatePurchaseOrder(entry.getValue(), orderIdAndOpOrderMap.get(successRet.getPlatformOrderId()));
System.out.println("getPlatformOrderId" + successRet.getPlatformOrderId());
dsRelatePurchaseOrder(purchaseOrder, orderIdAndOpOrderMap.get(successRet.getPlatformOrderId()));
}
}
@ -280,8 +289,11 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if (PurchaseOrderConst.DS_ENCRYPT_ORDER_TYPE_ALL_SELLER.equals(shopPurchaseSetting.getEncryptDsOrderType())) {
isSettingEncryptDsOrder = true;
}
Stream<String> sellerIdMd5sStream = shopPurchaseSetting.getAllowDsEncryptOrderSourceSellers().values().stream().map(SellerInfoDTO::getSellerIdMd5);
List<String> sellerIdMd5sList = sellerIdMd5sStream.collect(Collectors.toList());
Map<String, SellerInfoDTO> allowDsEncryptOrderSourceSellers = shopPurchaseSetting.getAllowDsEncryptOrderSourceSellers();
List<String> sellerIdMd5sList = new ArrayList<>();
if (allowDsEncryptOrderSourceSellers != null) {
sellerIdMd5sList = allowDsEncryptOrderSourceSellers.values().stream().map(SellerInfoDTO::getSellerIdMd5).collect(Collectors.toList());
}
if (sellerIdMd5sList.contains(sourceSellerId)) {
isSettingEncryptDsOrder = true;
}
@ -309,15 +321,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
private void checkConsigneeInfo(ConsigneeInfoDTO consigneeInfo) {
if (
StringUtils.isNotBlank(consigneeInfo.getFullname()) ||
StringUtils.isNotBlank(consigneeInfo.getMobile()) ||
StringUtils.isNotBlank(consigneeInfo.getProvince()) ||
StringUtils.isNotBlank(consigneeInfo.getCity()) ||
StringUtils.isNotBlank(consigneeInfo.getCounty()) ||
StringUtils.isNotBlank(consigneeInfo.getAddress()) ||
StringUtils.isNotBlank(consigneeInfo.getFullAddress())
StringUtils.isBlank(consigneeInfo.getFullname()) ||
StringUtils.isBlank(consigneeInfo.getMobile()) ||
StringUtils.isBlank(consigneeInfo.getProvince()) ||
StringUtils.isBlank(consigneeInfo.getCity()) ||
StringUtils.isBlank(consigneeInfo.getCounty()) ||
StringUtils.isBlank(consigneeInfo.getAddress()) ||
StringUtils.isBlank(consigneeInfo.getFullAddress())
) {
throw new RuntimeException("采购单参数异常");
throw new RuntimeException("采购单收件人异常");
}
}
@ -328,11 +340,13 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
List<Long> skuIds = new ArrayList<>();
for (PlatformOrderDTO platformOrder: platformOrders) {
for (PlatformOrderItemDTO item: platformOrder.getItems()) {
skuIds.add(item.getSourceSkuId());
skuIds.add(item.getPlatformSkuId());
}
}
HashMap<String, HashMap<Long, String>> orderIdAndSkuIdAndSkuSubNameMap = opOrderChildService.getOrderIdAndSkuIdAndSkuSubNameMap(orderIds, skuIds);
System.out.println("orderIdAndSkuIdAndSkuSubNameMap" + orderIdAndSkuIdAndSkuSubNameMap);
System.out.println("platformOrders" + platformOrders);
for (PlatformOrderDTO platformOrder: platformOrders) {
for (PlatformOrderItemDTO item: platformOrder.getItems()) {
item.setPlatformSkuSubName(orderIdAndSkuIdAndSkuSubNameMap.get(platformOrder.getPlatformOrderId()).get(item.getSourceSkuId()));
@ -353,7 +367,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
savePurchaseOrderInfo(purchaseOrderInfo, opOrder, skuIdAndOpOrderChildMap);
}
dsPurchaseOrderOutStorageAndUpdateRemark(purchaseOrderInfo, opOrder, purchaseOrder);
// dsPurchaseOrderOutStorageAndUpdateRemark(purchaseOrderInfo, opOrder, purchaseOrder);
}
private void dsPurchaseOrderOutStorageAndUpdateRemark(PurchaseOrderRequestDTO purchaseOrderInfo, OpOrder opOrder, PurchaseOrder purchaseOrder) {
@ -649,6 +663,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if (fields.contains(PurchaseOrderConst.PROFIT_RATIO_FIELD)) {
needProfitRatio = true;
}
System.out.println("purchaseOrders" + purchaseOrders);
PurchaseOrder firstPurchaseOrder = purchaseOrders.iterator().next();
String profitText = "";
@ -856,9 +871,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if (opOrderExt == null) {
opOrderExt = opOrderExtService.getByOrderId(orderId);
}
List<Integer> historySkuIds = opOrderChildService.getHistorySkuIdsByOrderId(orderId);
List<Integer> purchaseSkuIds = purchaseOrderItemService.getSkuIdsByOrderId(orderId);
List<Integer> noPurchaseSkuIds = historySkuIds.stream().filter(i -> !purchaseSkuIds.contains(i)).collect(Collectors.toList());
List<Long> historySkuIds = opOrderChildService.getSkuIdsByOrderId(orderId);
List<Long> purchaseSkuIds = purchaseOrderItemService.getSkuIdsByOrderId(orderId);
List<Long> noPurchaseSkuIds = historySkuIds.stream().filter(i -> !purchaseSkuIds.contains(i)).collect(Collectors.toList());
Integer filterPurchaseStatus = null;
if (purchaseSkuIds.isEmpty()) {
@ -1070,11 +1085,16 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
HashMap<Long, Double> purchasePriceMap = buildPurchaseOrderItemsPurchasePrice(skuIdAndOpOrderChildMap, needRebuildSkuIds, (double) 0, purchaseNumMap);
PurchaseOrder purchaseOrder = buildPurchaseOrderByDto(purchaseOrderRequestDto, oldPurchaseOrder, opOrder);
purchaseOrderService.updateByPrimaryKeySelective(purchaseOrder);
if (purchaseOrder.getPurchaseOrderId() != null && purchaseOrder.getPurchaseOrderId() > 0) {
purchaseOrderService.updateByPrimaryKeySelective(purchaseOrder);
} else {
purchaseOrderService.insertSelective(purchaseOrder);
}
// TODO purchase_order_ds_encrypt
Map<Long, PurchaseOrderItemRequestDTO> skuIdAndItemMap = purchaseOrderRequestDto.getSkuIdAndItemMap();
System.out.println("needRebuildSkuIds" + needRebuildSkuIds);
for (Long skuId: needRebuildSkuIds) {
OpOrderChild opOrderChild = skuIdAndOpOrderChildMap.get(skuId);
PurchaseOrderItem oldPurchaseOrderitem = oldPurchaseOrderItemMap.get(skuId);
@ -1142,10 +1162,10 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
Date purchaseOrderSendTime = null;
Date purchaseOrderStartTime = null;
if (StringUtils.isNotBlank(purchaseOrderRequestDto.getPurchaseOrderStartTime())) {
purchaseOrderStartTime = DateUtils.parseDate(purchaseOrderRequestDto.getPurchaseOrderStartTime(), new String[]{"yyyy-MM-dd HH:ii:ss"});
purchaseOrderStartTime = DateUtils.parseDate(purchaseOrderRequestDto.getPurchaseOrderStartTime(), new String[]{"yyyy-MM-dd HH:mm:ss"});
}
if (StringUtils.isNotBlank(purchaseOrderRequestDto.getPurchaseOrderSendTime())) {
purchaseOrderSendTime = DateUtils.parseDate(purchaseOrderRequestDto.getPurchaseOrderSendTime(), new String[]{"yyyy-MM-dd HH:ii:ss"});
purchaseOrderSendTime = DateUtils.parseDate(purchaseOrderRequestDto.getPurchaseOrderSendTime(), new String[]{"yyyy-MM-dd HH:mm:ss"});
}
String purchaseStatus = purchaseOrderRequestDto.getPurchaseOrderStatus();

@ -29,8 +29,17 @@ public class DsApiServiceImpl implements DsApiService {
}
@Override
public BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(BatchCreateDistributionOrdersRequestDTO request) {
String resp = execute("/order/batchCreateDistributionOrders", objectToMap(request));
public BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(Long shopId, BatchCreateDistributionOrdersRequestDTO request) {
request.setPlatform("dd");
request.setOperateInfo(createOperateInfo(shopId));
for (PlatformOrderDTO platformOrder: request.getPlatformOrders()) {
platformOrder.setShopId(SecurityTool.encodeByAES(String.valueOf(shopId)));
for (PlatformOrderItemDTO item: platformOrder.getItems()) {
item.setPlatformItemId(SecurityTool.encodeByAES(item.getPlatformItemId()));
}
}
// String resp = execute("/order/batchCreateDistributionOrders", objectToMap(request));
String resp = "{\"result\":\"success\",\"successCount\":1,\"failCount\":0,\"successList\":[{\"result\":\"success\",\"data\":{\"success\":true,\"totalSuccessAmount\":6500,\"orderId\":\"3507894290302847640\",\"postFee\":1500,\"mutilOrders\":null},\"createAlibabaOrderLogId\":960,\"platformOrderIds\":[\"6921501275308365608\"],\"isEncryptOrder\":1,\"isSupportEncryptOrder\":1,\"isUseManualConsignee\":0,\"flow\":\"fenxiao\",\"includeSplitJxhy\":false,\"sourceOrderIds\":[\"3507894290302847640\"],\"payRet\":{\"3507894290302847640\":{\"result\":\"fail\",\"code\":\"NO_SIGN_UP_ERROR\",\"reason\":\"\\u672a\\u7b7e\\u7ea6\\u6216\\u672a\\u7ed1\\u5b9a\"}},\"platformOrderId\":\"6921501275308365608\",\"relatePurchaseOrderInfos\":[{\"platformOrderId\":\"6921501275308365608\",\"purchasePlatform\":\"1688DS\",\"purchaseOrderSn\":\"3507894290302847640\",\"purchaseOrderBuyer\":\"goufx_ms\",\"purchaseOrderSeller\":\"\\u798f\\u5dde\\u67cf\\u4e3a\\u5546\\u8d38\\u6709\\u9650\\u516c\\u53f8\",\"purchaseOrderPayment\":\"65\",\"purchaseOrderFullname\":\"\\u53f6*\",\"purchaseOrderMobile\":\"1********51\",\"purchaseOrderFullAddress\":\"\\u7518\\u8083\\u7701 \\u5609\\u5cea\\u5173\\u5e02 \\u94a2\\u57ce\\u8857\\u9053 \\u8fce\\u5bbe*\\u8def****-*\\u53f7****\",\"purchaseOrderStartTime\":\"2023-09-05 16:57:29\",\"platformPushStatus\":\"wait\",\"purchaseOrderLogisticsName\":\"\",\"purchaseOrderWaybillCode\":\"\",\"purchaseOrderStatus\":\"wait_pay\",\"purchaseOrderFlow\":\"fenxiao\",\"alibabaOrderStatus\":\"waitbuyerpay\",\"isUseManualConsignee\":0,\"isDsEncryptOrder\":\"1\",\"isSupportEncryptOrder\":\"1\",\"logisticsIsAccept\":false,\"items\":[{\"skuId\":\"1759603409502271\",\"wareId\":\"3603667784447454901\",\"purchaseNum\":\"1\",\"purchasePrice\":\"50\",\"sourceItemId\":\"714710164290\"}],\"mergePurchasePlatformOrderIds\":null}]}],\"errorList\":null,\"lockSourceItems\":[{\"createPurchaseOrderLockSkuId\":\"1432\",\"createPurchaseOrderLockId\":\"20000973\",\"sourceItemId\":\"714710164290\",\"sourceSkuId\":\"5255522619991\",\"createPurchaseOrderLogId\":\"1017\",\"sourceOrderId\":\"3507894290302847640\",\"sourceNum\":null,\"reqId\":null,\"status\":\"lock\",\"gmtCreate\":\"2023-09-05 16:57:28\",\"gmtModified\":\"2023-09-05 16:57:29\",\"platformOrderId\":\"6921501275308365608\",\"platformItemId\":\"3603667784447454901\",\"platformSkuId\":\"1759603409502271\"}]}";
return JSON.parseObject(resp, BatchCreateDistributionOrdersResponseDTO.class);
}

@ -82,7 +82,7 @@ public class OpOrderChildServiceImpl implements OpOrderChildService{
return map;
}
public List<Integer> getHistorySkuIdsByOrderId(String orderId) {
public List<Long> getHistorySkuIdsByOrderId(String orderId) {
// TODO
return new ArrayList<>();
}
@ -132,6 +132,12 @@ public class OpOrderChildServiceImpl implements OpOrderChildService{
}
return orderIdAndChildrenMap;
}
@Override
public List<Long> getSkuIdsByOrderId(String orderId) {
List<OpOrderChild> children = opOrderChildMapper.getListByOrderId(orderId);
return children.stream().map(OpOrderChild::getSkuId).collect(Collectors.toList());
}
}

@ -281,13 +281,16 @@ public class OrderPrintServiceImpl implements OrderPrintService {
dsProductIds.add(purchaseOrderItem.getWareId());
}
}
System.out.println("purchaseOrderItems" + purchaseOrderItems);
System.out.println("dsProductIds" + dsProductIds);
System.out.println("productIdAndPurchasePlatformsMap" + productIdAndPurchasePlatformsMap);
if (dsProductIds.isEmpty()) {
return true;
} else {
boolean isDsProductAllPurchaseOtherPlatform = true;
for (String loopDsProductId : dsProductIds) {
Set<String> loopPurchasePlatformsMap = productIdAndPurchasePlatformsMap.get(loopDsProductId);
if (loopPurchasePlatformsMap.isEmpty() || loopPurchasePlatformsMap.contains(sourcePlatform)) {
if (loopPurchasePlatformsMap == null || loopPurchasePlatformsMap.isEmpty() || loopPurchasePlatformsMap.contains(sourcePlatform)) {
isDsProductAllPurchaseOtherPlatform = false;
break;
}

@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Objects;
/**
@ -56,17 +57,18 @@ public class PurchaseAccountServiceImpl implements PurchaseAccountService{
@Override
public PurchaseAccount savePurchaseAccount(Long shopId, String platform, String purchaseOrderBuyer) {
PurchaseAccount purchaseAccount = getByPurchaseOrderBuyer(shopId, platform, purchaseOrderBuyer);
if (purchaseAccount == null) {
System.out.println(purchaseAccount);
if (Objects.isNull(purchaseAccount)) {
purchaseAccount = new PurchaseAccount();
purchaseAccount.setShopId(shopId);
purchaseAccount.setPlatform(platform);
purchaseAccount.setPurchaseOrderBuyer(purchaseOrderBuyer);
purchaseAccount.setGmtCreate(new Date());
purchaseAccount.setGmtModified(new Date());
purchaseAccountMapper.updateByPrimaryKey(purchaseAccount);
purchaseAccountMapper.insertSelective(purchaseAccount);
} else {
purchaseAccount.setGmtModified(new Date());
purchaseAccountMapper.insert(purchaseAccount);
purchaseAccountMapper.updateByPrimaryKeySelective(purchaseAccount);
}
return purchaseAccount;
}

@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
@ -50,8 +51,9 @@ public class PurchaseOrderItemServiceImpl implements PurchaseOrderItemService{
}
@Override
public List<Integer> getSkuIdsByOrderId(String orderId) {
return null;
public List<Long> getSkuIdsByOrderId(String orderId) {
List<PurchaseOrderItem> items = purchaseOrderItemMapper.getSkuIdsByOrderId(orderId);;
return items.stream().map(PurchaseOrderItem::getSkuId).collect(Collectors.toList());
}
@Override

@ -37,6 +37,7 @@ public class BatchCreateDistributionOrdersService extends SPIBaseService impleme
data.put("errorList", response.getErrorList());
return R.ok(Ret.success(data));
} catch (Exception e) {
e.printStackTrace();
log.error("batchCreateDistributionOrders fail" + e.getMessage());
return R.ok(Ret.fail(e.getMessage()));
}

@ -37,4 +37,6 @@ public interface PurchaseOrderItemMapper {
int updateStatusByIds(@Param("status") String status, @Param("ids") List<Long> ids);
int updateStatusByOrderId(@Param("shopId") Long shopId, @Param("orderId") String orderId, @Param("status") String status);
List<PurchaseOrderItem> getSkuIdsByOrderId(@Param("orderId") String orderId);
}

@ -91,7 +91,7 @@
<select id="getByPurchaseOrderBuyer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from product_to_ds_item
from purchase_account
where shop_id = #{shopId,jdbcType=BIGINT}
and platform = #{platform,jdbcType=VARCHAR}
and purchase_order_buyer = #{purchaseOrderBuyer,jdbcType=VARCHAR}

@ -47,6 +47,15 @@
</if>
and status = #{status}
</select>
<select id="getSkuIdsByOrderId" resultType="com.ms.dal.entity.PurchaseOrderItem">
select
sku_id
from purchase_order_item poi
inner join purchase_order po on poi.purchase_order_id = po.purchase_order_id
where poi.order_id = #{orderId,jdbcType=VARCHAR}
and po.status = "normal"
and poi.status = "normal"
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select

@ -374,7 +374,7 @@
where shop_id = #{shopId,jdbcType=BIGINT}
and order_id = #{orderId,jdbcType=VARCHAR}
<if test="status != null">
and status = #{status,jdbcType=VARCHAR},
and status = #{status,jdbcType=VARCHAR}
</if>
</select>
<select id="getHasPurchaseHistoryShopIds" resultType="com.ms.dal.entity.PurchaseOrder">

@ -149,7 +149,7 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
</update>
<select id="getByShopId" parameterType="java.lang.String" resultMap="BaseResultMap">
<select id="getByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from purchase_setting

Loading…
Cancel
Save