Commit e534c3f0 authored by lihuiling's avatar lihuiling

加注释

parent 817b21b7
......@@ -275,12 +275,15 @@ public class CollectService {
sjLogSub1InfoMapper.updateState(sub1Id, ManageConstant.CommonStateEnum.COLEND.getCode());
}
}
//更新sjLog
long successCount = sjLogSub1Mapper.countSjState(sjLogId, " and sj_state = '" + ManageConstant.CommonStateEnum.COLEND.getCode() + "'");
sjLog.setSjSuss((int)successCount);
if (0 == sjLogSub1Mapper.countSjState(sjLogId, " and sj_state != '" + ManageConstant.CommonStateEnum.COLEND.getCode() + "'")) {
sjLog.setSjState(ManageConstant.CommonStateEnum.COLEND.getCode());
}else{
sjLog.setSjState(ManageConstant.CommonStateEnum.COLAIL.getCode());
}
sjLogMapper.updateById(sjLog);
}
}
......@@ -293,6 +296,7 @@ public class CollectService {
Integer fileTypeId = sjLogSub1.getFileTypeId();
Map<String, String> map = sjLogInfoPOList.stream().collect(Collectors.toMap(SjLogSub1InfoPO::getInfoKey, SjLogSub1InfoPO::getInfoValue));
//保存sub1的信息及文件
saveCcFileInfo(xtId, fileTypeId, ermsQiyePO, ermsOrganizationPO, map, xh, sjLogSub1, null);
QueryWrapper sub2Exam = new QueryWrapper();
......@@ -301,7 +305,7 @@ public class CollectService {
List<SjLogSub2PO> sjLogSub2List = sjLogSub2Mapper.selectList(sub2Exam);
int fjxh = 0;
//保存sub1下所有sub2的信息及文件
for(SjLogSub2PO sub2Po: sjLogSub2List){
fjxh++;
Integer sub2Id = sub2Po.getId();
......@@ -313,11 +317,13 @@ public class CollectService {
collectbySub2ById(xtId, ermsQiyePO, ermsOrganizationPO, sjLogSub2InfoPOList, fjxh, sjLogSub1);
}
//更新sub1状态
if(0 == sjLogSub2Mapper.countSjState(sub1Id, " and sj_state != '" +ManageConstant.CommonStateEnum.COLEND.getCode()+"'")){
sjLogSub1.setSjState(ManageConstant.CommonStateEnum.COLEND.getCode());
sjLogSub1Mapper.updateById(sjLogSub1);
}else{
sjLogSub1.setSjState(ManageConstant.CommonStateEnum.COLAIL.getCode());
}
sjLogSub1Mapper.updateById(sjLogSub1);
}
/*
......@@ -328,6 +334,7 @@ public class CollectService {
SjLogSub2PO sjLogSub2 = sjLogSub2Mapper.selectById(sub2Id);
Integer fileTypeId = sjLogSub2.getFileTypeId();
Map<String, String> map = sjLogInfoPOList.stream().collect(Collectors.toMap(SjLogSub2InfoPO::getInfoKey, SjLogSub2InfoPO::getInfoValue));
//保存sub2的信息及文件
saveCcFileInfo(xtId, fileTypeId, ermsQiyePO, ermsOrganizationPO, map, xh, sjLogSub1, sjLogSub2 );
}
......@@ -507,10 +514,12 @@ public class CollectService {
String status = "";
try {
//调用接口,获取文件信息
String res = HttpUtil.openHttpByPost("http://192.168.106.150:39091/" + "sjCollection/sjFile", fjObject.toString());
JSONObject jsonRes = JSONUtil.parseObj(res);
status = jsonRes.getStr("status");
if (StringUtils.equals("200", status)) {
//调用接口成功,保存文件
Map data = jsonRes.get("data", Map.class);
String fileData = (String) data.get("fileData");
......@@ -530,6 +539,7 @@ public class CollectService {
if(ManageConstant.CommonStateEnum.COLEND.getCode().equals(filePO.getState())) {
if (format.equals("pdf")) {
//如果是pdf文件,加签名
FileInputStream inputStream = new FileInputStream(file);
PdfReader pdfReader = new PdfReader(inputStream);
pagenumber = pdfReader.getNumberOfPages();
......@@ -558,7 +568,7 @@ public class CollectService {
//其他类型的文件默认页数是1
pagenumber = 1;
}
//保存文件信息
CcFileSaveInfoPO ccFileSaveInfoPO = new CcFileSaveInfoPO();
ccFileSaveInfoPO.setFileSize(fileSize.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
ccFileSaveInfoPO.setFilePath(fileName);
......@@ -576,6 +586,7 @@ public class CollectService {
errMsg = e.getMessage();
} finally {
if (errMsg != null) {
//采集文件发生错误,保存错误信息,更新对应sub记录的状态
SjLogErrorPO sjLogErrorPO = new SjLogErrorPO();
sjLogErrorPO.setSjLogSub1Id(sjLogSub1PO != null ? sjLogSub1PO.getId() : null);
sjLogErrorPO.setSjLogSub2Id(sjLogSub2PO != null ? sjLogSub2PO.getId() : null);
......@@ -590,6 +601,7 @@ public class CollectService {
sjLogSub1PO.setSjState(ManageConstant.CommonStateEnum.COLAIL.getCode());
sjLogSub1Mapper.updateById(sjLogSub1PO);
}else{
//如果获取文件成功且没有错误信息,更新文件信息及对应sub记录的状态
if (StringUtils.equals("200", status)) {
ccFileInfoMapper.upDateFile(fileTypeId, updateSql, uuid);
if (sjLogSub2PO != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment