|
@@ -12,6 +12,9 @@
|
|
|
上传照片
|
|
|
</button>
|
|
|
</a>
|
|
|
+ <div>
|
|
|
+ <input class="base-id-input" type="text" v-model="baseID" placeholder="不处理小于此数字的身份证照片">
|
|
|
+ </div>
|
|
|
<div class='progress-div'>
|
|
|
<div>
|
|
|
<span>
|
|
@@ -89,12 +92,14 @@ export default {
|
|
|
returnMsgList: [], //返回信息
|
|
|
successNum: 0, //成功数量
|
|
|
errorNum: 0, //失败数量
|
|
|
+ skipNum: 0, //跳过数量
|
|
|
allNum: 0, //总数
|
|
|
completeShow: false,
|
|
|
- reqNum: 0,
|
|
|
- startProcessTime: null,
|
|
|
- endProcessTime: null,
|
|
|
- processSpeed: 0
|
|
|
+ baseID: "", // 从大于这个身份证号开始处理
|
|
|
+ reqNum: 0, // 并发请求数
|
|
|
+ startProcessTime: null, // 开始处理的时间
|
|
|
+ endProcessTime: null, // 结束处理的时间
|
|
|
+ processSpeed: 0 // 处理的速度:个/秒
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -143,7 +148,7 @@ export default {
|
|
|
},
|
|
|
processQueueSingle(taskQueue1000) {
|
|
|
// 并发处理请求,可在控制台查看请求峰值
|
|
|
- CONCURRENCY = new Date().getHours() < 6 ? 8 : 5;
|
|
|
+ CONCURRENCY = new Date().getHours() < 6 ? 9 : 7;
|
|
|
async.parallelLimit(taskQueue1000, CONCURRENCY, (err, results) => {
|
|
|
if (err) {
|
|
|
alert(err);
|
|
@@ -167,12 +172,18 @@ export default {
|
|
|
const identityNumber = path
|
|
|
.basename(studentPhotoPath)
|
|
|
.replace(fileSuffix, ""); //文件名就是身份证号码
|
|
|
+
|
|
|
+ if (this.lessThanBaseID(identityNumber)) {
|
|
|
+ this.finishOnePhotoSuccess("跳过处理", studentPhotoPath);
|
|
|
+ this.skipNum++;
|
|
|
+ return;
|
|
|
+ }
|
|
|
const photoFile = fs.readFileSync(studentPhotoPath);
|
|
|
const rootOrgId = localStorage.getItem("rootOrgId");
|
|
|
this.reqNum = window.requestInProcessingTotal;
|
|
|
|
|
|
this.processSpeed =
|
|
|
- (this.successNum + this.errorNum) /
|
|
|
+ (this.successNum + this.errorNum - this.skipNum) /
|
|
|
(Date.now() - this.startProcessTime);
|
|
|
|
|
|
//生成新名称
|
|
@@ -380,6 +391,10 @@ export default {
|
|
|
msg: msg
|
|
|
});
|
|
|
this.successNum++;
|
|
|
+ fs.appendFileSync(
|
|
|
+ path.join(path.dirname(studentPhotoPath), "successPhotos.txt"),
|
|
|
+ path.basename(studentPhotoPath) + ":" + msg + "\n"
|
|
|
+ );
|
|
|
},
|
|
|
logout() {
|
|
|
localStorage.removeItem("rootOrgId");
|
|
@@ -388,6 +403,9 @@ export default {
|
|
|
this.$router.push({
|
|
|
path: "/login"
|
|
|
});
|
|
|
+ },
|
|
|
+ lessThanBaseID(identityNumber) {
|
|
|
+ return identityNumber < this.baseID; //字符串比较,从第一个字符比较起
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -443,7 +461,7 @@ export default {
|
|
|
.import-body {
|
|
|
display: grid;
|
|
|
height: calc(100vh - 100px);
|
|
|
- grid-template-rows: 250px 1fr;
|
|
|
+ grid-template-rows: 270px 1fr;
|
|
|
}
|
|
|
|
|
|
.import-div {
|
|
@@ -466,6 +484,12 @@ export default {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
+.base-id-input {
|
|
|
+ margin-top: 10px;
|
|
|
+ width: 300px;
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+
|
|
|
.progress-div {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|