|
|
|
@ -2,6 +2,7 @@ package com.example.upsecuritydata.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.example.upsecuritydata.cache.CodeCache; |
|
|
|
@ -117,13 +118,26 @@ public class MethodImpl implements Method {
|
|
|
|
|
.lt(NbmsEntApply::getUpdateDate, yyyyMMddToday) |
|
|
|
|
.list(); |
|
|
|
|
} |
|
|
|
|
// 全量操作
|
|
|
|
|
if (type == 2) { |
|
|
|
|
list = nbmsEntApplyServcie.lambdaQuery().eq(NbmsEntApply::getFirstAuditStatus, 2) |
|
|
|
|
.eq(NbmsEntApply::getApplyType, 1) |
|
|
|
|
.eq(NbmsEntApply::getApplyStep, 4) |
|
|
|
|
.list(); |
|
|
|
|
} |
|
|
|
|
// 创建输出流
|
|
|
|
|
FileOutputStream stream = new FileOutputStream(Constant.localNotEncryFileNamePath); |
|
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
|
for (NbmsEntApply nbmsEnapply : list) { |
|
|
|
|
companyCode = nbmsEnapply.getEntPrefix(); |
|
|
|
|
companyName = nbmsEnapply.getOrgName(); |
|
|
|
|
level = "4"; |
|
|
|
|
List<String> split = StrUtil.split(companyCode, "."); |
|
|
|
|
if ("000000".equals(split.get(2))) { |
|
|
|
|
level = "4"; |
|
|
|
|
} else { |
|
|
|
|
level = "5"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
accessProvince = nbmsEnapply.getOrgAddrProvince(); |
|
|
|
|
accessProvince = CodeCache.codeMap.get(accessProvince); |
|
|
|
|
|
|
|
|
@ -160,9 +174,9 @@ public class MethodImpl implements Method {
|
|
|
|
|
@Override |
|
|
|
|
public Boolean creatForUpFile(Integer type, String yyyyMMdd, String yyyyMMddToday) throws IOException { |
|
|
|
|
String companyName; // 标识解析节点经营主体名称
|
|
|
|
|
String startIP = "223.99.228.240"; |
|
|
|
|
String endIP = "223.99.228.240"; |
|
|
|
|
String position = "中国山东省济南市自由贸易试验区济南片区颖秀路2299号"; |
|
|
|
|
String startIP = "112.6.110.61"; |
|
|
|
|
String endIP = "112.6.110.61"; |
|
|
|
|
String position = "山东省济宁市济宁宁化大数据中心"; |
|
|
|
|
List<NbmsEnprefix> list = null; |
|
|
|
|
if (type == 0) { |
|
|
|
|
list = enprefixService.query() |
|
|
|
@ -229,6 +243,13 @@ public class MethodImpl implements Method {
|
|
|
|
|
.lt(NbmsEntApply::getUpdateDate, yyyyMMddToday) |
|
|
|
|
.list(); |
|
|
|
|
} |
|
|
|
|
// 全量操作
|
|
|
|
|
if (type == 2) { |
|
|
|
|
list = nbmsEntApplyServcie.lambdaQuery().eq(NbmsEntApply::getFirstAuditStatus, 2) |
|
|
|
|
.eq(NbmsEntApply::getApplyType, 1) |
|
|
|
|
.eq(NbmsEntApply::getApplyStep, 4) |
|
|
|
|
.list(); |
|
|
|
|
} |
|
|
|
|
// 创建输出流
|
|
|
|
|
FileOutputStream stream = new FileOutputStream(Constant.localNotEncryFileNamePath); |
|
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
@ -253,7 +274,7 @@ public class MethodImpl implements Method {
|
|
|
|
|
companyType = judge(nbmsEnapply.getOrgNature()); |
|
|
|
|
serviceProfession = categoryB; |
|
|
|
|
|
|
|
|
|
String template = companyCode + "|" + companyName + "|" + "|" + accessProvince + "|" + accessCity + "|" + registerTime + "|" + categoryA + "|" + categoryB + "|" + companyType + "|" + serviceProfession + "\n"; |
|
|
|
|
String template = companyCode + "|" + companyName + "|" + accessProvince + "|" + accessCity + "|" + registerTime + "|" + categoryA + "|" + categoryB + "|" + companyType + "|" + serviceProfession + "\n"; |
|
|
|
|
byte[] bytes = template.getBytes(); |
|
|
|
|
stream.write(bytes); |
|
|
|
|
} |
|
|
|
|