|
|
@ -18,6 +18,7 @@ import org.springframework.stereotype.Service; |
|
|
import java.io.BufferedReader; |
|
|
import java.io.BufferedReader; |
|
|
import java.io.FileReader; |
|
|
import java.io.FileReader; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author zhangjing |
|
|
* @author zhangjing |
|
|
@ -86,6 +87,7 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
// 获取近三个月的案件 d_larq 立案日期字段 |
|
|
// 获取近三个月的案件 d_larq 立案日期字段 |
|
|
QueryWrapper<LawCase> query = new QueryWrapper<>(); |
|
|
QueryWrapper<LawCase> query = new QueryWrapper<>(); |
|
|
query.ge("d_larq", threeMonthsAgo); |
|
|
query.ge("d_larq", threeMonthsAgo); |
|
|
|
|
|
query.ge("credit_code", creditCode); |
|
|
List<LawCase> caseList = this.list(query); |
|
|
List<LawCase> caseList = this.list(query); |
|
|
if (needLitigant){ |
|
|
if (needLitigant){ |
|
|
for (LawCase lawCase : caseList) { |
|
|
for (LawCase lawCase : caseList) { |
|
|
@ -115,6 +117,7 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
// 获取近三个月的案件 d_larq 立案日期字段 |
|
|
// 获取近三个月的案件 d_larq 立案日期字段 |
|
|
QueryWrapper<LawCase> query = new QueryWrapper<>(); |
|
|
QueryWrapper<LawCase> query = new QueryWrapper<>(); |
|
|
query.ge("d_larq", threeMonthsAgo); |
|
|
query.ge("d_larq", threeMonthsAgo); |
|
|
|
|
|
query.ge("credit_code", creditCode); |
|
|
List<LawCase> caseList = this.list(query); |
|
|
List<LawCase> caseList = this.list(query); |
|
|
for (LawCase lawCase : caseList) { |
|
|
for (LawCase lawCase : caseList) { |
|
|
QueryWrapper<LitigantInfo> infoQueryWrapper = new QueryWrapper<>(); |
|
|
QueryWrapper<LitigantInfo> infoQueryWrapper = new QueryWrapper<>(); |
|
|
@ -158,13 +161,6 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
private void setAlarmInfo(String creditCode){ |
|
|
private void setAlarmInfo(String creditCode){ |
|
|
EnterpriseAlarmInfo data = new EnterpriseAlarmInfo(); |
|
|
EnterpriseAlarmInfo data = new EnterpriseAlarmInfo(); |
|
|
data.setCreditCode(creditCode); |
|
|
data.setCreditCode(creditCode); |
|
|
//告警数 |
|
|
|
|
|
QueryWrapper<AlarmCase> alarmCaseQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
alarmCaseQueryWrapper.eq("credit_code", creditCode); |
|
|
|
|
|
data.setAlarmCount(alarmCaseService.count(alarmCaseQueryWrapper)); |
|
|
|
|
|
//告警案件金额 |
|
|
|
|
|
List<LawCase> alarmCases = baseMapper.queryByAlarmCase(creditCode); |
|
|
|
|
|
data.setAlarmAmount(ReportUtil.getCaseAmount(alarmCases)); |
|
|
|
|
|
//近三月案件信息 |
|
|
//近三月案件信息 |
|
|
List<LawCase> threeMonths = threeMonthsCases(creditCode,false); |
|
|
List<LawCase> threeMonths = threeMonthsCases(creditCode,false); |
|
|
data.setThreeMonthsCount(threeMonths.size()); |
|
|
data.setThreeMonthsCount(threeMonths.size()); |
|
|
@ -182,50 +178,50 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void judicialModelSave(JSONObject jsonObject) { |
|
|
public void judicialModelSave(JSONObject jsonObject) { |
|
|
// setAlarmInfo("91440300087909371X"); |
|
|
|
|
|
|
|
|
setAlarmInfo("915101007234134581"); |
|
|
|
|
|
|
|
|
// ReportModel reportModel = createReportData(); |
|
|
// ReportModel reportModel = createReportData(); |
|
|
// ReportUtil.createReport(reportModel); |
|
|
// ReportUtil.createReport(reportModel); |
|
|
// String filePath = "司法.txt"; |
|
|
|
|
|
String filePath = "工商.txt"; |
|
|
|
|
|
|
|
|
String filePath = "司法.txt"; |
|
|
|
|
|
// String filePath = "工商.txt"; |
|
|
String jsonOutput = convertTextToJson(filePath); |
|
|
String jsonOutput = convertTextToJson(filePath); |
|
|
if (jsonOutput == null) { |
|
|
if (jsonOutput == null) { |
|
|
logger.error("转换失败,JSON 字符串为空"); |
|
|
logger.error("转换失败,JSON 字符串为空"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
jsonObject = new JSONObject().parseObject(jsonOutput); |
|
|
jsonObject = new JSONObject().parseObject(jsonOutput); |
|
|
enterpriseInfoService.industryModelSave(jsonObject); |
|
|
|
|
|
// JSONArray arr = jsonObject.getJSONArray("data"); |
|
|
|
|
|
// if (arr == null || arr.isEmpty()) { |
|
|
|
|
|
// logger.error("数据数组为空"); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// JSONObject data = arr.getJSONObject(0); |
|
|
|
|
|
// String info = data.getString("id"); |
|
|
|
|
|
// String companyName = null; |
|
|
|
|
|
// String creditCode = null; |
|
|
|
|
|
// if (info != null) { |
|
|
|
|
|
// String[] items = info.split(":"); |
|
|
|
|
|
// if (items.length == 2) { |
|
|
|
|
|
// companyName = items[0]; |
|
|
|
|
|
// creditCode = items[1]; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// // 失信 |
|
|
|
|
|
// JSONObject sx = data.getJSONObject("sx"); |
|
|
|
|
|
// JSONArray sxbzxrCurrent = sx.getJSONArray("sxbzxr_current"); |
|
|
|
|
|
// String finalCompanyName = companyName; |
|
|
|
|
|
// String finalCreditCode = creditCode; |
|
|
|
|
|
// List<DishonestInfo> dishonestInfoList = JSON.parseArray(sxbzxrCurrent.toString(), DishonestInfo.class) |
|
|
|
|
|
// .stream() |
|
|
|
|
|
// .peek(p -> { |
|
|
|
|
|
// p.setCompanyName(finalCompanyName); |
|
|
|
|
|
// p.setCreditCode(finalCreditCode); |
|
|
|
|
|
// }) |
|
|
|
|
|
// .collect(Collectors.toList()); |
|
|
|
|
|
// dishonestInfoService.saveOrUpdateBatch(dishonestInfoList); |
|
|
|
|
|
|
|
|
// enterpriseInfoService.industryModelSave(jsonObject); |
|
|
|
|
|
JSONArray arr = jsonObject.getJSONArray("data"); |
|
|
|
|
|
if (arr == null || arr.isEmpty()) { |
|
|
|
|
|
logger.error("数据数组为空"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JSONObject data = arr.getJSONObject(0); |
|
|
|
|
|
String info = data.getString("id"); |
|
|
|
|
|
String companyName = null; |
|
|
|
|
|
String creditCode = null; |
|
|
|
|
|
if (info != null) { |
|
|
|
|
|
String[] items = info.split(":"); |
|
|
|
|
|
if (items.length == 2) { |
|
|
|
|
|
companyName = items[0]; |
|
|
|
|
|
creditCode = items[1]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 失信 |
|
|
|
|
|
JSONObject sx = data.getJSONObject("sx"); |
|
|
|
|
|
JSONArray sxbzxrCurrent = sx.getJSONArray("sxbzxr_current"); |
|
|
|
|
|
String finalCompanyName = companyName; |
|
|
|
|
|
String finalCreditCode = creditCode; |
|
|
|
|
|
List<DishonestInfo> dishonestInfoList = JSON.parseArray(sxbzxrCurrent.toString(), DishonestInfo.class) |
|
|
|
|
|
.stream() |
|
|
|
|
|
.peek(p -> { |
|
|
|
|
|
p.setCompanyName(finalCompanyName); |
|
|
|
|
|
p.setCreditCode(finalCreditCode); |
|
|
|
|
|
}) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
dishonestInfoService.saveOrUpdateBatch(dishonestInfoList); |
|
|
// |
|
|
// |
|
|
// // 八类案件 |
|
|
// // 八类案件 |
|
|
// JSONObject detail = data.getJSONObject("detail"); |
|
|
// JSONObject detail = data.getJSONObject("detail"); |
|
|
@ -289,9 +285,9 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!caseList.isEmpty()) { |
|
|
|
|
|
// saveOrUpdateCases(caseList); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
if (!caseList.isEmpty()) { |
|
|
|
|
|
saveOrUpdateCases(caseList); |
|
|
|
|
|
} |
|
|
if (!litigantInfoList.isEmpty()) { |
|
|
if (!litigantInfoList.isEmpty()) { |
|
|
QueryWrapper<LitigantInfo> queryWrapper = new QueryWrapper<>(); |
|
|
QueryWrapper<LitigantInfo> queryWrapper = new QueryWrapper<>(); |
|
|
queryWrapper.in("n_ajbs", nAjbsList); |
|
|
queryWrapper.in("n_ajbs", nAjbsList); |
|
|
|