|
|
@@ -521,9 +521,12 @@ public class KwfTruckReportService {
|
|
|
//有效上报信息
|
|
|
List<KwfTruckReportDto> effective = new ArrayList();
|
|
|
//已有运力/识别失败
|
|
|
- int haveCount = Global.NUMERICAL_ZERO, errorCount = Global.NUMERICAL_ZERO, rowIndex = Global.NUMERICAL_ZERO;
|
|
|
+ int haveCount = Global.NUMERICAL_ZERO, errorCount = Global.NUMERICAL_ZERO,
|
|
|
+ rowIndex = Global.NUMERICAL_ZERO, repeatCount = Global.NUMERICAL_ZERO;
|
|
|
List<String> errorMsg = new ArrayList<>();
|
|
|
List<String> haveMsg = new ArrayList<>();
|
|
|
+ List<String> repeatMsg = new ArrayList<>();
|
|
|
+ List<String> valueStr = new ArrayList<>();
|
|
|
for (String str:params){
|
|
|
rowIndex ++;
|
|
|
/**识别上报数据**/
|
|
|
@@ -539,6 +542,16 @@ public class KwfTruckReportService {
|
|
|
if (StringUtils.isNotBlank(haveMessage)) {
|
|
|
haveCount ++;
|
|
|
haveMsg.add("第" + rowIndex + "行数据," + haveMessage);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**校验重复数据*/
|
|
|
+ if (valueStr.contains(reportDto.getTruckNo()+reportDto.getPhone())) {
|
|
|
+ repeatCount ++;
|
|
|
+ repeatMsg.add("第" + rowIndex + "行数据重复!");
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ valueStr.add(reportDto.getTruckNo() + reportDto.getPhone());
|
|
|
}
|
|
|
effective.add(reportDto);
|
|
|
}
|
|
|
@@ -549,10 +562,13 @@ public class KwfTruckReportService {
|
|
|
resultMap.put("haveMsg", haveMsg);
|
|
|
resultMap.put("errorCount", errorCount);
|
|
|
resultMap.put("errorMsg", errorMsg);
|
|
|
+ resultMap.put("repeatCount", repeatCount);
|
|
|
+ resultMap.put("repeatMsg", repeatMsg);
|
|
|
resultMap.put("fail", haveCount + errorCount);
|
|
|
resultMap.put("success", effective.size());
|
|
|
resultMap.put("list", effective);
|
|
|
return HttpResult.ok(resultMap);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -628,8 +644,8 @@ public class KwfTruckReportService {
|
|
|
|
|
|
//司机姓名-非空
|
|
|
String name = strArray[1];
|
|
|
- if (StringUtils.isBlank(name) || name.trim().length() == 0) {
|
|
|
- msg.append("司机姓名不能为空!");
|
|
|
+ if (StringUtils.isBlank(name) || name.trim().length() == 0 || name.trim().length() > 25) {
|
|
|
+ msg.append("司机姓名格式不正确!");
|
|
|
}
|
|
|
|
|
|
//司机电话-非空/手机号正则校验
|