|
|
|
@ -124,8 +124,9 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
String msg;
|
|
|
|
String msg;
|
|
|
|
int success;
|
|
|
|
int success;
|
|
|
|
int total;
|
|
|
|
int total;
|
|
|
|
|
|
|
|
List<DaPicturesRecard> failList = new ArrayList<>();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//取所有id的集合
|
|
|
|
//取所有id的集合 stream()有顺序
|
|
|
|
List<Long> ids = picRecards.stream().map(DaPicturesRecard::getId).collect(Collectors.toList());
|
|
|
|
List<Long> ids = picRecards.stream().map(DaPicturesRecard::getId).collect(Collectors.toList());
|
|
|
|
String ywType = picRecards.get(0).getYwType();
|
|
|
|
String ywType = picRecards.get(0).getYwType();
|
|
|
|
Long muId = picRecards.get(0).getMuId();
|
|
|
|
Long muId = picRecards.get(0).getMuId();
|
|
|
|
@ -164,12 +165,16 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
msg = jsonobject.getStr("msg");
|
|
|
|
msg = jsonobject.getStr("msg");
|
|
|
|
success = jsonobject.getInt("success");
|
|
|
|
success = jsonobject.getInt("success");
|
|
|
|
total = jsonobject.getInt("total");
|
|
|
|
total = jsonobject.getInt("total");
|
|
|
|
|
|
|
|
//失败id
|
|
|
|
|
|
|
|
String failPicid = jsonobject.getStr("failPicid");
|
|
|
|
|
|
|
|
//获取失败的id集合
|
|
|
|
|
|
|
|
List<Long> failIds = JSONArray.parseArray(failPicid, Long.class);
|
|
|
|
|
|
|
|
//并行不带顺序取出失败集合
|
|
|
|
|
|
|
|
failList = picRecards.parallelStream().filter(recard -> failIds.contains(recard.getId())).collect(Collectors.toList());
|
|
|
|
//如果code=0 识别失败,直接返回
|
|
|
|
//如果code=0 识别失败,直接返回
|
|
|
|
if (code.equals("0")) {
|
|
|
|
if (code.equals("0")) {
|
|
|
|
return AjaxResult.error(msg + ", 成功:" + success + " , 总共:" + total);
|
|
|
|
return AjaxResult.error(msg + ", 成功:" + success + " , 总共:" + total);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//识别接口方说:多张识别,要么全识别成功,要么一张也识别不成功 ,所以---------failPicids暂时不用 失败则全失败
|
|
|
|
|
|
|
|
// String failPicid=jsonobject.getStr("msg");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String datas = jsonobject.getStr("datas");
|
|
|
|
String datas = jsonobject.getStr("datas");
|
|
|
|
|
|
|
|
|
|
|
|
@ -197,14 +202,12 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
//获取常住人口信息集合
|
|
|
|
//获取常住人口信息集合
|
|
|
|
List<CzrkDatas> czrkDatas = JSONArray.parseArray(datas, CzrkDatas.class);
|
|
|
|
List<CzrkDatas> czrkDatas = JSONArray.parseArray(datas, CzrkDatas.class);
|
|
|
|
for (CzrkDatas czrkData : czrkDatas) {
|
|
|
|
for (CzrkDatas czrkData : czrkDatas) {
|
|
|
|
List<Long> picid = czrkData.getPicid();
|
|
|
|
List<Long> picids = czrkData.getPicid();
|
|
|
|
// 将Long类型映射为String类型, 并将Stream转换为数组
|
|
|
|
String picIds = StringUtils.join(picids, ",");//分号分割
|
|
|
|
String[] spicId = picid.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
List<String> picUrls = picRecards.stream()
|
|
|
|
String picIds = StringUtils.join(spicId, ",");//分号分割
|
|
|
|
.filter(recard -> picids.contains(recard.getId()))
|
|
|
|
//存储图片url
|
|
|
|
.map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
List<String> picUrls = picRecards.stream().map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
String pictures = StringUtils.join(picUrls, ",");//分号分割
|
|
|
|
String[] pics = picUrls.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
|
|
|
|
String pictures = StringUtils.join(pics, ",");//分号分割
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DaCzrkdj> info = czrkData.getInfo();
|
|
|
|
List<DaCzrkdj> info = czrkData.getInfo();
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
@ -217,6 +220,8 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
daCzrkdj.setCreateTime(new Date());
|
|
|
|
daCzrkdj.setCreateTime(new Date());
|
|
|
|
daCzrkdj.setYwType(ywType);
|
|
|
|
daCzrkdj.setYwType(ywType);
|
|
|
|
daCzrkdj.setMuId(muId);
|
|
|
|
daCzrkdj.setMuId(muId);
|
|
|
|
|
|
|
|
daCzrkdj.setAuditStatus("0");
|
|
|
|
|
|
|
|
daCzrkdj.setErrorCorrect("0");
|
|
|
|
daCzrkdjService.insertDaCzrkdj(daCzrkdj);
|
|
|
|
daCzrkdjService.insertDaCzrkdj(daCzrkdj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -227,14 +232,12 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
//获取出生医学证明信息集合
|
|
|
|
//获取出生医学证明信息集合
|
|
|
|
List<CszmDatas> cszmDatas = JSONArray.parseArray(datas, CszmDatas.class);
|
|
|
|
List<CszmDatas> cszmDatas = JSONArray.parseArray(datas, CszmDatas.class);
|
|
|
|
for (CszmDatas cszmData : cszmDatas) {
|
|
|
|
for (CszmDatas cszmData : cszmDatas) {
|
|
|
|
List<Long> picid = cszmData.getPicid();
|
|
|
|
List<Long> picids = cszmData.getPicid();
|
|
|
|
// 将Long类型映射为String类型, 并将Stream转换为数组
|
|
|
|
String picIds = StringUtils.join(picids, ",");//分号分割
|
|
|
|
String[] spicId = picid.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
List<String> picUrls = picRecards.stream()
|
|
|
|
String picIds = StringUtils.join(spicId, ",");//分号分割
|
|
|
|
.filter(recard -> picids.contains(recard.getId()))
|
|
|
|
//存储图片url
|
|
|
|
.map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
List<String> picUrls = picRecards.stream().map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
String pictures = StringUtils.join(picUrls, ",");//分号分割
|
|
|
|
String[] pics = picUrls.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
|
|
|
|
String pictures = StringUtils.join(pics, ",");//分号分割
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DaBirthDj> info = cszmData.getInfo();
|
|
|
|
List<DaBirthDj> info = cszmData.getInfo();
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
@ -247,6 +250,8 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
daBirthdj.setCreateTime(new Date());
|
|
|
|
daBirthdj.setCreateTime(new Date());
|
|
|
|
daBirthdj.setYwType(ywType);
|
|
|
|
daBirthdj.setYwType(ywType);
|
|
|
|
daBirthdj.setMuId(muId);
|
|
|
|
daBirthdj.setMuId(muId);
|
|
|
|
|
|
|
|
daBirthdj.setAuditStatus("0");
|
|
|
|
|
|
|
|
daBirthdj.setErrorCorrect("0");
|
|
|
|
daBirthDjService.insertDaBirthDj(daBirthdj);
|
|
|
|
daBirthDjService.insertDaBirthDj(daBirthdj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -256,14 +261,12 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
//获取迁移证信息集合
|
|
|
|
//获取迁移证信息集合
|
|
|
|
List<QyzDatas> qyzDatas = JSONArray.parseArray(datas, QyzDatas.class);
|
|
|
|
List<QyzDatas> qyzDatas = JSONArray.parseArray(datas, QyzDatas.class);
|
|
|
|
for (QyzDatas qyzData : qyzDatas) {
|
|
|
|
for (QyzDatas qyzData : qyzDatas) {
|
|
|
|
List<Long> picid = qyzData.getPicid();
|
|
|
|
List<Long> picids = qyzData.getPicid();
|
|
|
|
// 将Long类型映射为String类型, 并将Stream转换为数组
|
|
|
|
String picIds = StringUtils.join(picids, ",");//分号分割
|
|
|
|
String[] spicId = picid.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
List<String> picUrls = picRecards.stream()
|
|
|
|
String picIds = StringUtils.join(spicId, ",");//分号分割
|
|
|
|
.filter(recard -> picids.contains(recard.getId()))
|
|
|
|
//存储图片url
|
|
|
|
.map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
List<String> picUrls = picRecards.stream().map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
String pictures = StringUtils.join(picUrls, ",");//分号分割
|
|
|
|
String[] pics = picUrls.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
|
|
|
|
String pictures = StringUtils.join(pics, ",");//分号分割
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DaQyz> info = qyzData.getInfo();
|
|
|
|
List<DaQyz> info = qyzData.getInfo();
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
@ -276,6 +279,8 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
qyz.setCreateTime(new Date());
|
|
|
|
qyz.setCreateTime(new Date());
|
|
|
|
qyz.setYwType(ywType);
|
|
|
|
qyz.setYwType(ywType);
|
|
|
|
qyz.setMuId(muId);
|
|
|
|
qyz.setMuId(muId);
|
|
|
|
|
|
|
|
qyz.setAuditStatus("0");
|
|
|
|
|
|
|
|
qyz.setErrorCorrect("0");
|
|
|
|
daQyzService.insertDaQyz(qyz);
|
|
|
|
daQyzService.insertDaQyz(qyz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -285,14 +290,12 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
//获取一胎证明信息集合
|
|
|
|
//获取一胎证明信息集合
|
|
|
|
List<YtzmDatas> ytzmDatas = JSONArray.parseArray(datas, YtzmDatas.class);
|
|
|
|
List<YtzmDatas> ytzmDatas = JSONArray.parseArray(datas, YtzmDatas.class);
|
|
|
|
for (YtzmDatas ytzmData : ytzmDatas) {
|
|
|
|
for (YtzmDatas ytzmData : ytzmDatas) {
|
|
|
|
List<Long> picid = ytzmData.getPicid();
|
|
|
|
List<Long> picids = ytzmData.getPicid();
|
|
|
|
// 将Long类型映射为String类型, 并将Stream转换为数组
|
|
|
|
String picIds = StringUtils.join(picids, ",");//分号分割
|
|
|
|
String[] spicId = picid.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
List<String> picUrls = picRecards.stream()
|
|
|
|
String picIds = StringUtils.join(spicId, ",");//分号分割
|
|
|
|
.filter(recard -> picids.contains(recard.getId()))
|
|
|
|
//存储图片url
|
|
|
|
.map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
List<String> picUrls = picRecards.stream().map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
String pictures = StringUtils.join(picUrls, ",");//分号分割
|
|
|
|
String[] pics = picUrls.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
|
|
|
|
String pictures = StringUtils.join(pics, ",");//分号分割
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DaYtzm> info = ytzmData.getInfo();
|
|
|
|
List<DaYtzm> info = ytzmData.getInfo();
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
@ -305,6 +308,8 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
ytzm.setCreateTime(new Date());
|
|
|
|
ytzm.setCreateTime(new Date());
|
|
|
|
ytzm.setYwType(ywType);
|
|
|
|
ytzm.setYwType(ywType);
|
|
|
|
ytzm.setMuId(muId);
|
|
|
|
ytzm.setMuId(muId);
|
|
|
|
|
|
|
|
ytzm.setAuditStatus("0");
|
|
|
|
|
|
|
|
ytzm.setErrorCorrect("0");
|
|
|
|
daYtzmService.insertDaYtzm(ytzm);
|
|
|
|
daYtzmService.insertDaYtzm(ytzm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -314,14 +319,12 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
//获取转非农业人口批复存根信息集合
|
|
|
|
//获取转非农业人口批复存根信息集合
|
|
|
|
List<ZfnyDatas> zfnyDatas = JSONArray.parseArray(datas, ZfnyDatas.class);
|
|
|
|
List<ZfnyDatas> zfnyDatas = JSONArray.parseArray(datas, ZfnyDatas.class);
|
|
|
|
for (ZfnyDatas zfnyData : zfnyDatas) {
|
|
|
|
for (ZfnyDatas zfnyData : zfnyDatas) {
|
|
|
|
List<Long> picid = zfnyData.getPicid();
|
|
|
|
List<Long> picids = zfnyData.getPicid();
|
|
|
|
// 将Long类型映射为String类型, 并将Stream转换为数组
|
|
|
|
String picIds = StringUtils.join(picids, ",");//分号分割
|
|
|
|
String[] spicId = picid.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
List<String> picUrls = picRecards.stream()
|
|
|
|
String picIds = StringUtils.join(spicId, ",");//分号分割
|
|
|
|
.filter(recard -> picids.contains(recard.getId()))
|
|
|
|
//存储图片url
|
|
|
|
.map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
List<String> picUrls = picRecards.stream().map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
String pictures = StringUtils.join(picUrls, ",");//分号分割
|
|
|
|
String[] pics = picUrls.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
|
|
|
|
String pictures = StringUtils.join(pics, ",");//分号分割
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DaZfnyhkcg> info = zfnyData.getInfo();
|
|
|
|
List<DaZfnyhkcg> info = zfnyData.getInfo();
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
@ -334,6 +337,8 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
zfnyhkcg.setCreateTime(new Date());
|
|
|
|
zfnyhkcg.setCreateTime(new Date());
|
|
|
|
zfnyhkcg.setYwType(ywType);
|
|
|
|
zfnyhkcg.setYwType(ywType);
|
|
|
|
zfnyhkcg.setMuId(muId);
|
|
|
|
zfnyhkcg.setMuId(muId);
|
|
|
|
|
|
|
|
zfnyhkcg.setAuditStatus("0");
|
|
|
|
|
|
|
|
zfnyhkcg.setErrorCorrect("0");
|
|
|
|
daZfnyhkcgService.insertDaZfnyhkcg(zfnyhkcg);
|
|
|
|
daZfnyhkcgService.insertDaZfnyhkcg(zfnyhkcg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -343,14 +348,12 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
//获取准迁证信息集合
|
|
|
|
//获取准迁证信息集合
|
|
|
|
List<ZqzDatas> zqzDatas = JSONArray.parseArray(datas, ZqzDatas.class);
|
|
|
|
List<ZqzDatas> zqzDatas = JSONArray.parseArray(datas, ZqzDatas.class);
|
|
|
|
for (ZqzDatas zqzData : zqzDatas) {
|
|
|
|
for (ZqzDatas zqzData : zqzDatas) {
|
|
|
|
List<Long> picid = zqzData.getPicid();
|
|
|
|
List<Long> picids = zqzData.getPicid();
|
|
|
|
// 将Long类型映射为String类型, 并将Stream转换为数组
|
|
|
|
String picIds = StringUtils.join(picids, ",");//分号分割
|
|
|
|
String[] spicId = picid.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
List<String> picUrls = picRecards.stream()
|
|
|
|
String picIds = StringUtils.join(spicId, ",");//分号分割
|
|
|
|
.filter(recard -> picids.contains(recard.getId()))
|
|
|
|
//存储图片url
|
|
|
|
.map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
List<String> picUrls = picRecards.stream().map(DaPicturesRecard::getPicUrl).collect(Collectors.toList());
|
|
|
|
String pictures = StringUtils.join(picUrls, ",");//分号分割
|
|
|
|
String[] pics = picUrls.stream().map(Object::toString).toArray(String[]::new);
|
|
|
|
|
|
|
|
String pictures = StringUtils.join(pics, ",");//分号分割
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DaZqz> info = zqzData.getInfo();
|
|
|
|
List<DaZqz> info = zqzData.getInfo();
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
if (info != null && info.size() > 0) {
|
|
|
|
@ -363,13 +366,18 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
zqz.setCreateTime(new Date());
|
|
|
|
zqz.setCreateTime(new Date());
|
|
|
|
zqz.setYwType(ywType);
|
|
|
|
zqz.setYwType(ywType);
|
|
|
|
zqz.setMuId(muId);
|
|
|
|
zqz.setMuId(muId);
|
|
|
|
|
|
|
|
zqz.setAuditStatus("0");
|
|
|
|
|
|
|
|
zqz.setErrorCorrect("0");
|
|
|
|
daZqzService.insertDaZqz(zqz);
|
|
|
|
daZqzService.insertDaZqz(zqz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//三方识别接口:要么全部成功 要么全部失败——————修改图片信息记录表为已识别 可以用多线程
|
|
|
|
//修改图片信息记录表为已识别 可以用多线程
|
|
|
|
|
|
|
|
if (failList.size() > 0) {
|
|
|
|
|
|
|
|
picRecards.removeAll(failList);
|
|
|
|
|
|
|
|
}
|
|
|
|
for (DaPicturesRecard picRecard : picRecards) {
|
|
|
|
for (DaPicturesRecard picRecard : picRecards) {
|
|
|
|
picRecard.setRecognize("1");
|
|
|
|
picRecard.setRecognize("1");
|
|
|
|
daPicturesRecardService.updateDaPicturesRecard(picRecard);
|
|
|
|
daPicturesRecardService.updateDaPicturesRecard(picRecard);
|
|
|
|
@ -379,8 +387,8 @@ public class DangAnCollectController extends BaseController {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// return AjaxResult.success("成功:"+success+" , 总共:"+total);
|
|
|
|
return AjaxResult.success("成功:" + success + " , 总共:"+total).put("fails", failList);
|
|
|
|
return AjaxResult.success();
|
|
|
|
// return AjaxResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|