|
|
@@ -126,11 +126,15 @@ public class CmsOrderController {
|
|
|
|
|
|
private final UserBenefitsOrderRecordMapper userBenefitsOrderRecordMapper;
|
|
|
|
|
|
+ private final OrderDonDifferRelateMapper orderDonDifferRelateMapper;
|
|
|
+
|
|
|
+ private final OrderDonDifferGoodsMapper orderDonDifferGoodsMapper;
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
@SaCheckPermission("order:view")
|
|
|
- public Result<SearchResult<OrderDonBackView>> get(Long channelId, String account, String showId, Long acId, String nickname, String register, Boolean isGoogle, Boolean isSubsidy, Boolean isRenewPackage, Integer otherOrderType, Long userMirrorShopId) {
|
|
|
+ public Result<SearchResult<OrderDonBackView>> get(Long channelId, String account, String showId, Long acId, String nickname, String register, Boolean isGoogle, Boolean isSubsidy, Boolean isRenewPackage, Integer otherOrderType, Long userMirrorShopId, String operator, Long diffGoodsId) {
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
if (channelId != null) {
|
|
|
List<Long> popularizeIds = channelPopularizeMapper.getPopularizeIdByChannelId(channelId);
|
|
|
@@ -206,6 +210,19 @@ public class CmsOrderController {
|
|
|
}
|
|
|
conditionSql += String.format(" exists (select 1 from user_mirror_shop_order_relate umr where mp_id = %s and umr.order_id = o.id limit 1)", userMirrorShopId);
|
|
|
}
|
|
|
+ if (diffGoodsId != null || StrUtil.isNotBlank(operator)) {
|
|
|
+ if (StrUtil.isNotEmpty(conditionSql)) {
|
|
|
+ conditionSql += " and ";
|
|
|
+ }
|
|
|
+ conditionSql += " exists (select 1 from order_don_differ_relate odr where odr.order_id = o.id";
|
|
|
+ if (diffGoodsId != null) {
|
|
|
+ conditionSql += String.format(" and odr.goods_id = %s", diffGoodsId);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(operator)) {
|
|
|
+ conditionSql += String.format(" and odr.operator = '%s'", operator);
|
|
|
+ }
|
|
|
+ conditionSql += ")";
|
|
|
+ }
|
|
|
if (StrUtil.isNotBlank(conditionSql)) {
|
|
|
builder.put("condition", conditionSql);
|
|
|
}
|
|
|
@@ -286,6 +303,15 @@ public class CmsOrderController {
|
|
|
data.setNickname(e.getNickname());
|
|
|
});
|
|
|
}
|
|
|
+ //补差价订单
|
|
|
+ if (data.getGoodsDonType() != null && data.getGoodsDonType() == 5) {
|
|
|
+ OrderDonDifferRelateView donDifferRelateView = beanSearcher.searchFirst(OrderDonDifferRelateView.class, MapUtils.builder().field(OrderDonDifferRelateView::getOrderId, data.getId()).build());
|
|
|
+ if (donDifferRelateView != null) {
|
|
|
+ data.setDiffGoodsId(donDifferRelateView.getGoodsId());
|
|
|
+ data.setDiffTitle(donDifferRelateView.getTitle());
|
|
|
+ data.setDiffOperator(donDifferRelateView.getOperator());
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
@@ -335,7 +361,7 @@ public class CmsOrderController {
|
|
|
@GetMapping("/export")
|
|
|
@SaCheckPermission("order:export")
|
|
|
@Log(module = "订单管理/导出订单", businessType = BusinessType.EXPORT, isSaveRequestData = true)
|
|
|
- public void exportOrders(HttpServletResponse response, Long channelId, String account, String showId, Long acId, String nickname, String register, Boolean isGoogle, Boolean isSubsidy, Boolean isRenewPackage, Integer otherOrderType, Long userMirrorShopId) throws InterruptedException {
|
|
|
+ public void exportOrders(HttpServletResponse response, Long channelId, String account, String showId, Long acId, String nickname, String register, Boolean isGoogle, Boolean isSubsidy, Boolean isRenewPackage, Integer otherOrderType, Long userMirrorShopId, String operator, Long diffGoodsId) throws InterruptedException {
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
if (channelId != null) {
|
|
|
List<Long> popularizeIds = channelPopularizeMapper.getPopularizeIdByChannelId(channelId);
|
|
|
@@ -405,6 +431,19 @@ public class CmsOrderController {
|
|
|
builder.put("tb", String.format(" inner join user_mirror_shop_order_relate umr on umr.order_id = o.id"));
|
|
|
}
|
|
|
}
|
|
|
+ if (diffGoodsId != null || StrUtil.isNotBlank(operator)) {
|
|
|
+ if (StrUtil.isNotEmpty(conditionSql)) {
|
|
|
+ conditionSql += " and ";
|
|
|
+ }
|
|
|
+ conditionSql += " exists (select 1 from order_don_differ_relate odr where odr.order_id = o.id";
|
|
|
+ if (diffGoodsId != null) {
|
|
|
+ conditionSql += String.format(" and odr.goods_id = %s", diffGoodsId);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(operator)) {
|
|
|
+ conditionSql += String.format(" and odr.operator = '%s'", operator);
|
|
|
+ }
|
|
|
+ conditionSql += ")";
|
|
|
+ }
|
|
|
if (userMirrorShopId != null) {
|
|
|
conditionSql += String.format(" exists (select 1 from user_mirror_shop_order_relate umr where mp_id = %s and umr.order_id = o.id limit 1)", userMirrorShopId);
|
|
|
}
|
|
|
@@ -1239,7 +1278,50 @@ public class CmsOrderController {
|
|
|
data.setCouponName(couponMapper.getCouponNameByCouponUserId(data.getCouponUserId()));
|
|
|
data.setCouponMoney(data.getCouponMoney() == null ? BigDecimal.ZERO : data.getCouponMoney());
|
|
|
}
|
|
|
+ //差价订单
|
|
|
+ if (data.getGoodsDonType() != null && data.getGoodsDonType() == 5) {
|
|
|
+ OrderDonDifferRelateView orderDonDifferRelateView = beanSearcher.searchFirst(OrderDonDifferRelateView.class, MapUtils.builder().field(OrderDonDifferRelateView::getOrderId, data.getId()).build());
|
|
|
+ if (orderDonDifferRelateView != null) {
|
|
|
+ data.setDiffInfo(orderDonDifferRelateView.getTitle() + "-" + orderDonDifferRelateView.getOperator());
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
countDownLatch.countDown();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 补差价可选平台
|
|
|
+ */
|
|
|
+ @GetMapping("/get/diff/goods")
|
|
|
+ public Result<List<OrderDonDifferGoods>> getDiffGoods() {
|
|
|
+ List<OrderDonDifferGoods> orderDonDifferGoods = beanSearcher.searchAll(OrderDonDifferGoods.class, MapUtils.flatBuilder(request.getParameterMap()).orderBy(OrderDonDifferGoods::getGoodsId).build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(orderDonDifferGoods);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增补差价平台
|
|
|
+ */
|
|
|
+ @PostMapping("/post/diff/goods")
|
|
|
+ public Result<String> insertDiffGoods(@RequestBody OrderDonDifferGoods orderDonDifferGoods) {
|
|
|
+ try {
|
|
|
+ orderDonDifferGoodsMapper.insert(orderDonDifferGoods);
|
|
|
+ } catch (DuplicateKeyException e) {
|
|
|
+ }
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新补差价订单关联信息
|
|
|
+ */
|
|
|
+ @PutMapping("/update/diff/info")
|
|
|
+ public Result<String> updateDiffOrderDonInfo(@RequestBody OrderDonDifferRelate relate) {
|
|
|
+ OrderDonDifferRelate orderDonDifferRelate = orderDonDifferRelateMapper.selectOne(Wrappers.lambdaQuery(OrderDonDifferRelate.class)
|
|
|
+ .eq(OrderDonDifferRelate::getOrderId, relate.getOrderId())
|
|
|
+ .last("limit 1"));
|
|
|
+ if (orderDonDifferRelate != null) {
|
|
|
+ relate.setId(orderDonDifferRelate.getId());
|
|
|
+ orderDonDifferRelateMapper.updateById(relate);
|
|
|
+ } else orderDonDifferRelateMapper.insert(relate);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
}
|