|
@@ -74,20 +74,20 @@ public class ManLocationFileProcessor implements Processor {
|
|
List<ManResult> manResultList = new ArrayList<>();
|
|
List<ManResult> manResultList = new ArrayList<>();
|
|
//文件读取完返回结果
|
|
//文件读取完返回结果
|
|
List<ManFtpResult> manFtpResultList = ExcelUtil.readExcel(fileDir + splitTag + fileName);
|
|
List<ManFtpResult> manFtpResultList = ExcelUtil.readExcel(fileDir + splitTag + fileName);
|
|
|
|
+
|
|
|
|
+ ManResult manResult = new ManResult();
|
|
if (manFtpResultList.size() > 0) {
|
|
if (manFtpResultList.size() > 0) {
|
|
manFtpResultService.insert(manFtpResultList);
|
|
manFtpResultService.insert(manFtpResultList);
|
|
//根据文件名称获取时间
|
|
//根据文件名称获取时间
|
|
- String[] beforStr = fileName.split("_");
|
|
|
|
- String[] str = beforStr[1].split("\\.");
|
|
|
|
|
|
+// String[] beforStr = fileName.split("_");
|
|
|
|
+ String[] str = fileName.split("\\.");
|
|
fileName = str[0];
|
|
fileName = str[0];
|
|
Long beginTime = Long.parseLong(fileName) - 10000;
|
|
Long beginTime = Long.parseLong(fileName) - 10000;
|
|
Long endTime = Long.parseLong(fileName);
|
|
Long endTime = Long.parseLong(fileName);
|
|
//查询时间段内的数据
|
|
//查询时间段内的数据
|
|
- List<Man> manList = manService.selectByTime(beginTime, endTime);
|
|
|
|
- //查询传入数据并返回数据
|
|
|
|
|
|
+ for (ManFtpResult manFtpResult : manFtpResultList) {
|
|
|
|
|
|
- ManResult manResult;
|
|
|
|
- for (Man man : manList) {
|
|
|
|
|
|
+ Man man = manService.selectById(manFtpResult.getManId());
|
|
//从数据库查询的结果跟 excel结果进行比对
|
|
//从数据库查询的结果跟 excel结果进行比对
|
|
manResult = new ManResult();
|
|
manResult = new ManResult();
|
|
String userName = man.getUserName();
|
|
String userName = man.getUserName();
|
|
@@ -104,50 +104,44 @@ public class ManLocationFileProcessor implements Processor {
|
|
manResult.setResultCode(1001);
|
|
manResult.setResultCode(1001);
|
|
manResult.setCallBlackUrl(man.getCallBlackUrl());
|
|
manResult.setCallBlackUrl(man.getCallBlackUrl());
|
|
|
|
|
|
|
|
+ //如果身份证号码一致设置参数
|
|
|
|
+ if (man.getIdCard().equals(manFtpResult.getIdCard()) && man.getName().equals(manFtpResult.getName())) {
|
|
|
|
|
|
- for (ManFtpResult manFtpResult : manFtpResultList) {
|
|
|
|
-
|
|
|
|
- //如果身份证号码一致设置参数
|
|
|
|
- if (man.getIdCard().equals(manFtpResult.getIdCard()) && man.getName().equals(manFtpResult.getName())) {
|
|
|
|
-
|
|
|
|
- String isIdCard = manFtpResult.getIsIdCard();
|
|
|
|
- String isDrugs = manFtpResult.getIsDrugs();
|
|
|
|
- String isEcape = manFtpResult.getIsEscape();
|
|
|
|
- String isPedigree = manFtpResult.getIsPedigree();
|
|
|
|
- manResult.setResultCode(1000);
|
|
|
|
-
|
|
|
|
- //判断返回码是否为2 如果是2 设置状态码1002 不计费
|
|
|
|
- if (("2").equals(isIdCard)) {
|
|
|
|
- manResult.setResultCode(1002);
|
|
|
|
- }
|
|
|
|
- if (("2").equals(isDrugs)) {
|
|
|
|
- manResult.setResultCode(1002);
|
|
|
|
- }
|
|
|
|
- if (("2").equals(isEcape)) {
|
|
|
|
- manResult.setResultCode(1002);
|
|
|
|
- }
|
|
|
|
- if (("2").equals(isPedigree)) {
|
|
|
|
- manResult.setResultCode(1002);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- name = manFtpResult.getName();
|
|
|
|
- manResult.setName(name);
|
|
|
|
- manResult.setUserName(userName);
|
|
|
|
- manResult.setIdCard(idCard);
|
|
|
|
- manResult.setIsIdCard(stringForInt(isIdCard));
|
|
|
|
- manResult.setIsEscape(stringForInt(isEcape));
|
|
|
|
- manResult.setIsDrugs(stringForInt(isDrugs));
|
|
|
|
- manResult.setIsPedigree(stringForInt(isPedigree));
|
|
|
|
- //查询是成功设置1000
|
|
|
|
|
|
+ String isIdCard = manFtpResult.getIsIdCard();
|
|
|
|
+ String isDrugs = manFtpResult.getIsDrugs();
|
|
|
|
+ String isEcape = manFtpResult.getIsEscape();
|
|
|
|
+ String isPedigree = manFtpResult.getIsPedigree();
|
|
|
|
+ manResult.setResultCode(1000);
|
|
|
|
|
|
|
|
+ //判断返回码是否为2 如果是2 设置状态码1002 不计费
|
|
|
|
+ if (("2").equals(isIdCard)) {
|
|
|
|
+ manResult.setResultCode(1002);
|
|
|
|
+ }
|
|
|
|
+ if (("2").equals(isDrugs)) {
|
|
|
|
+ manResult.setResultCode(1002);
|
|
|
|
+ }
|
|
|
|
+ if (("2").equals(isEcape)) {
|
|
|
|
+ manResult.setResultCode(1002);
|
|
|
|
+ }
|
|
|
|
+ if (("2").equals(isPedigree)) {
|
|
|
|
+ manResult.setResultCode(1002);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ name = manFtpResult.getName();
|
|
|
|
+ manResult.setName(name);
|
|
|
|
+ manResult.setUserName(userName);
|
|
|
|
+ manResult.setIdCard(idCard);
|
|
|
|
+ manResult.setIsIdCard(stringForInt(isIdCard));
|
|
|
|
+ manResult.setIsEscape(stringForInt(isEcape));
|
|
|
|
+ manResult.setIsDrugs(stringForInt(isDrugs));
|
|
|
|
+ manResult.setIsPedigree(stringForInt(isPedigree));
|
|
|
|
+ //查询是成功设置1000
|
|
}
|
|
}
|
|
//设置返回批次
|
|
//设置返回批次
|
|
manResult.setBatch(fileName);
|
|
manResult.setBatch(fileName);
|
|
manResultList.add(manResult);
|
|
manResultList.add(manResult);
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 将返回结果返回给回调地址
|
|
* 将返回结果返回给回调地址
|
|
*/
|
|
*/
|
|
@@ -155,7 +149,6 @@ public class ManLocationFileProcessor implements Processor {
|
|
manResultList.forEach(manResults -> {
|
|
manResultList.forEach(manResults -> {
|
|
//发送请求给回调地址
|
|
//发送请求给回调地址
|
|
try {
|
|
try {
|
|
-
|
|
|
|
HttpEntity httpEntity = restTemplate.postForEntity(manResults.getCallBlackUrl(), manResults,
|
|
HttpEntity httpEntity = restTemplate.postForEntity(manResults.getCallBlackUrl(), manResults,
|
|
String.class);
|
|
String.class);
|
|
int stateCode = 200;
|
|
int stateCode = 200;
|
|
@@ -185,8 +178,6 @@ public class ManLocationFileProcessor implements Processor {
|
|
chargeService.insert(charge);
|
|
chargeService.insert(charge);
|
|
log.error("回调地址不通:{}", manResults.getCallBlackUrl());
|
|
log.error("回调地址不通:{}", manResults.getCallBlackUrl());
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
});
|
|
});
|
|
manResultService.insert(manResultList);
|
|
manResultService.insert(manResultList);
|
|
} else {
|
|
} else {
|