Commit c12d9a8c authored by zhengyi's avatar zhengyi

检查目的国与渠道是否匹配

parent 7d745210
......@@ -33,6 +33,7 @@ import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
......@@ -216,6 +217,9 @@ public class WarehouseController {
channelInfoEvent.setChannelId(requestVO.getChannelId());
applicationContext.publishEvent(channelInfoEvent);
if (Objects.nonNull(channelInfoEvent.getCountryId()) && channelInfoEvent.getCountryId() > 0L){
if (Objects.nonNull(requestVO.getDestCountryId()) && requestVO.getDestCountryId() > 0L && requestVO.getDestCountryId() != channelInfoEvent.getCountryId()) {
return error(400,"目的国与渠道不匹配");
}
requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
......
......@@ -29,6 +29,7 @@ import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "app-web - 仓库")
......@@ -137,6 +138,9 @@ public class AppWarehouseController {
channelInfoEvent.setChannelId(requestVO.getChannelId());
applicationContext.publishEvent(channelInfoEvent);
if (Objects.nonNull(channelInfoEvent.getCountryId()) && channelInfoEvent.getCountryId() > 0L){
if (Objects.nonNull(requestVO.getDestCountryId()) && requestVO.getDestCountryId() > 0L && requestVO.getDestCountryId() != channelInfoEvent.getCountryId()) {
return error(400,"目的国与渠道不匹配");
}
requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment