Browse Source

导入

v1.0
15989082884@163.com 2 years ago
parent
commit
129487590d
  1. 6
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java
  2. 10
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java

6
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java

@ -200,6 +200,9 @@ public class BmsChannelController {
param.forEach(a->{ param.forEach(a->{
a.setErrorInfo(""); a.setErrorInfo("");
if(a.getType().equals("4")){
return;
}
if(!StringUtils.hasText(a.getChannelName())){ if(!StringUtils.hasText(a.getChannelName())){
a.setErrorInfo(a.getErrorInfo()+"渠道名称不能为空;"); a.setErrorInfo(a.getErrorInfo()+"渠道名称不能为空;");
} }
@ -227,6 +230,9 @@ public class BmsChannelController {
List<String> existSupplierName = supplierList.stream().map(a -> a.getName()).collect(Collectors.toList()); List<String> existSupplierName = supplierList.stream().map(a -> a.getName()).collect(Collectors.toList());
if (supplierList.size() < supplierNames.size()) { if (supplierList.size() < supplierNames.size()) {
param.forEach(a -> { param.forEach(a -> {
if(a.getType().equals("4")){
return;
}
List<String> noExistName = a.getSupplierNames().stream().filter(b -> !existSupplierName.contains(b)).collect(Collectors.toList()); List<String> noExistName = a.getSupplierNames().stream().filter(b -> !existSupplierName.contains(b)).collect(Collectors.toList());
if (noExistName.size() > 0) { if (noExistName.size() > 0) {
a.setErrorInfo(a.getErrorInfo() + "不存在客户" + noExistName.stream().collect(Collectors.joining(",")) + ";"); a.setErrorInfo(a.getErrorInfo() + "不存在客户" + noExistName.stream().collect(Collectors.joining(",")) + ";");

10
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java

@ -271,7 +271,11 @@ public class BmsChannelPointController {
@PreAuthorize("hasRole('bms:channelPoint:insert')") @PreAuthorize("hasRole('bms:channelPoint:insert')")
public R<?> importExcel(@RequestBody @Valid List<BmsChannelPoint4ExcelBo> param){ public R<?> importExcel(@RequestBody @Valid List<BmsChannelPoint4ExcelBo> param){
param.forEach(a->{ param.forEach(a->{
a.setErrorInfo(""); a.setErrorInfo("");
if(a.getType().equals("4")){
return;
}
if(!StringUtils.hasText(a.getChannelCode())){ if(!StringUtils.hasText(a.getChannelCode())){
a.setErrorInfo(a.getErrorInfo()+"渠道编码不能为空;"); a.setErrorInfo(a.getErrorInfo()+"渠道编码不能为空;");
} }
@ -318,6 +322,9 @@ public class BmsChannelPointController {
List<String> existChannelCode = channelList.stream().map(a -> a.getChannelCode()).collect(Collectors.toList()); List<String> existChannelCode = channelList.stream().map(a -> a.getChannelCode()).collect(Collectors.toList());
if(channelList.size()<channelCodes.size()) { if(channelList.size()<channelCodes.size()) {
param.forEach(a -> { param.forEach(a -> {
if(a.getType().equals("4")){
return;
}
if(!existChannelCode.contains(a.getChannelCode())){ if(!existChannelCode.contains(a.getChannelCode())){
a.setErrorInfo(a.getErrorInfo()+"不存在该渠道编码;"); a.setErrorInfo(a.getErrorInfo()+"不存在该渠道编码;");
} }
@ -339,6 +346,9 @@ public class BmsChannelPointController {
List<String> existRegion2Code = region2List.stream().map(a -> a.getCode()).collect(Collectors.toList()); List<String> existRegion2Code = region2List.stream().map(a -> a.getCode()).collect(Collectors.toList());
if(region2List.size()<bizRegionCodes.size()) { if(region2List.size()<bizRegionCodes.size()) {
param.forEach(a -> { param.forEach(a -> {
if(a.getType().equals("4")){
return;
}
if(!existRegion2Code.contains(a.getBizRegionCode())){ if(!existRegion2Code.contains(a.getBizRegionCode())){
a.setErrorInfo(a.getErrorInfo()+"不存在该行政区域编码;"); a.setErrorInfo(a.getErrorInfo()+"不存在该行政区域编码;");
} }

Loading…
Cancel
Save