|
|
|
@ -2,16 +2,14 @@ package org.dromara.system.controller.app;
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaIgnore; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import jodd.util.StringUtil; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.dromara.common.core.domain.R; |
|
|
|
|
import org.dromara.common.web.core.BaseController; |
|
|
|
|
import org.dromara.system.domain.vo.SysBusinessVo; |
|
|
|
|
import org.dromara.system.domain.vo.SysDictDataVo; |
|
|
|
|
import org.dromara.system.domain.vo.YunliDeliveryRespVo; |
|
|
|
|
import org.dromara.system.service.DeliveryService; |
|
|
|
|
import org.dromara.system.service.ISysBusinessService; |
|
|
|
|
import org.dromara.system.service.ISysDictDataService; |
|
|
|
|
import org.dromara.system.service.ISysDictTypeService; |
|
|
|
|
import org.dromara.system.service.*; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
@ -19,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -37,6 +36,8 @@ public class ApiDeliveryController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final DeliveryService deliveryService; |
|
|
|
|
|
|
|
|
|
private final ISysConfigService sysConfigService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 配送运力 |
|
|
|
@ -47,7 +48,20 @@ public class ApiDeliveryController extends BaseController {
|
|
|
|
|
public R<List<YunliDeliveryRespVo.CapacityList>> dictType(@PathVariable Long businessId) { |
|
|
|
|
SysBusinessVo sysBusinessVo = businessService.queryById(businessId); |
|
|
|
|
YunliDeliveryRespVo respVo = deliveryService.queryYunList(sysBusinessVo.getShopNo()); |
|
|
|
|
return R.ok(respVo.getCapacityList().stream().filter(a->a.getStatus()==1L).toList()); |
|
|
|
|
List<YunliDeliveryRespVo.CapacityList> list = respVo.getCapacityList().stream().filter(a -> a.getStatus() == 1L).toList(); |
|
|
|
|
//屏蔽掉的运力
|
|
|
|
|
String s = sysConfigService.selectConfigByKey("shield.yunli"); |
|
|
|
|
if(StringUtil.isNotEmpty(s)){ |
|
|
|
|
List<String> shieldList = Arrays.stream(s.split(",")).toList(); |
|
|
|
|
List<YunliDeliveryRespVo.CapacityList> whiteList = new ArrayList<>(); |
|
|
|
|
for (YunliDeliveryRespVo.CapacityList capacityList : list) { |
|
|
|
|
if (!shieldList.contains(capacityList.getCapacityId().toString())) { |
|
|
|
|
whiteList.add(capacityList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.ok(whiteList); |
|
|
|
|
} |
|
|
|
|
return R.ok(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|