|
@@ -1,25 +1,40 @@
|
|
|
package com.cyksj.service.order.impl;
|
|
package com.cyksj.service.order.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.cyksj.common.constant.Constant;
|
|
|
|
|
+import com.cyksj.common.util.Jsons;
|
|
|
|
|
+import com.cyksj.mapper.OrderDonMapper;
|
|
|
|
|
+import com.cyksj.mapper.SysConfigMapper;
|
|
|
import com.cyksj.mapper.order.OrderDonPostMapper;
|
|
import com.cyksj.mapper.order.OrderDonPostMapper;
|
|
|
|
|
+import com.cyksj.model.entity.OrderDon;
|
|
|
import com.cyksj.model.entity.OrderDonPost;
|
|
import com.cyksj.model.entity.OrderDonPost;
|
|
|
|
|
+import com.cyksj.model.entity.SysConfig;
|
|
|
import com.cyksj.service.order.OrderDonPostService;
|
|
import com.cyksj.service.order.OrderDonPostService;
|
|
|
import com.cyksj.service.order.post.AbstractPostDataService;
|
|
import com.cyksj.service.order.post.AbstractPostDataService;
|
|
|
import com.cyksj.service.order.post.PostDataFactory;
|
|
import com.cyksj.service.order.post.PostDataFactory;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @author chan
|
|
* @author chan
|
|
|
* @date 2023/5/16 11:05 AM
|
|
* @date 2023/5/16 11:05 AM
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
public class OrderDonPostServiceImpl extends ServiceImpl<OrderDonPostMapper, OrderDonPost> implements OrderDonPostService {
|
|
public class OrderDonPostServiceImpl extends ServiceImpl<OrderDonPostMapper, OrderDonPost> implements OrderDonPostService {
|
|
|
|
|
|
|
|
|
|
+ private final OrderDonMapper orderDonMapper;
|
|
|
|
|
+
|
|
|
|
|
+ private final SysConfigMapper sysConfigMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void postData(Long orderId) throws Exception {
|
|
public void postData(Long orderId) throws Exception {
|
|
|
OrderDonPost orderPost = this.getOne(Wrappers.lambdaQuery(OrderDonPost.class).eq(OrderDonPost::getOrderId, orderId).eq(OrderDonPost::getStatus, Boolean.FALSE));
|
|
OrderDonPost orderPost = this.getOne(Wrappers.lambdaQuery(OrderDonPost.class).eq(OrderDonPost::getOrderId, orderId).eq(OrderDonPost::getStatus, Boolean.FALSE));
|
|
@@ -27,6 +42,21 @@ public class OrderDonPostServiceImpl extends ServiceImpl<OrderDonPostMapper, Ord
|
|
|
log.info("post 数据 不了存在 id:{}", orderId);
|
|
log.info("post 数据 不了存在 id:{}", orderId);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (orderPost.getType() == OrderDonPost.Type.BaiDu) {
|
|
|
|
|
+ SysConfig baiduFilterConfig = sysConfigMapper.selectOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
|
|
+ .eq(SysConfig::getSysKey, Constant.BAIDU_POST_FILTER_GOODS_KEY).last("limit 1"));
|
|
|
|
|
+ if (baiduFilterConfig != null) {
|
|
|
|
|
+ String sysValue = baiduFilterConfig.getSysValue();
|
|
|
|
|
+ if (StrUtil.isNotBlank(sysValue)) {
|
|
|
|
|
+ List<Long> baiduFilterGoods = Jsons.parseList(sysValue, Long.class);
|
|
|
|
|
+ OrderDon orderDon = orderDonMapper.selectById(orderId);
|
|
|
|
|
+ if (baiduFilterGoods.contains(orderDon.getGoodsId())) {
|
|
|
|
|
+ log.info("baidu 不回传该商品. 该订单商品id:{}", orderDon.getGoodsId());
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
post(orderId, orderPost);
|
|
post(orderId, orderPost);
|
|
|
}
|
|
}
|
|
|
|
|
|