WebStatisticsController.java
5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package com.lhcredit.project.webbusiness.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.lhcredit.common.utils.StringUtils;
import com.lhcredit.common.utils.spring.SpringUtils;
import com.lhcredit.framework.aspectj.lang.annotation.CheckToken;
import com.lhcredit.framework.web.domain.AjaxResult;
import com.lhcredit.framework.web.page.TableDataInfo;
import com.lhcredit.project.business.BasicInformation.service.BasicInformationService;
import com.lhcredit.project.business.TianYC.entity.param.RequestParams;
import com.lhcredit.project.business.TianYC.entity.param.SFParams;
import com.lhcredit.project.business.judicial.domain.VO.PromptStatisticsVO;
import com.lhcredit.project.business.judicial.service.JudicialService;
import com.lhcredit.project.business.judicial.service.PromptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import static com.lhcredit.framework.web.domain.AjaxResult.success;
@Api(tags = "统计信息")
@Controller
@RequestMapping("/api-V2.0/statistics")
@RequiredArgsConstructor
public class WebStatisticsController {
private final PromptService promptService;
private final JudicialService judicialService;
private final BasicInformationService basicInformationService;
@ResponseBody
@ApiOperation(value = "案件统计", notes = "案件统计")
@ApiImplicitParam(name = "name", value = "公司名称", required = true, dataType = "String")
@PostMapping("/case/statistics")
@CheckToken
public AjaxResult caseInfo(@RequestParam("name") String name) {
return promptService.findAllCaseCount(name);
}
@ResponseBody
@ApiOperation(value = "风险提示统计", notes = "风险提示统计")
@PostMapping("/prompt/statistics")
@CheckToken
public AjaxResult prompt(@RequestBody SFParams sfParams) {
//查询公司曾用名
// WebBasicInformationController bean = SpringUtils.getBean(WebBasicInformationController.class);
// RequestParams requestParams = new RequestParams();
//// requestParams.setName(sfParams.getName());
// requestParams.setCreditCode(sfParams.getCreditCode());
// AjaxResult base = bean.base(requestParams);
// JSONObject object = JSONObject.parseObject(JSON.toJSONString(base));
// JSONObject data = object.getJSONObject("data");
// String historyNames = data.getString("historyNames");
//----------------------------------------------------------
AjaxResult prompt = promptService.prompt(sfParams.getCreditCode());
// //如果曾用名存在
// if (StringUtils.isNotEmpty(historyNames)){
// AjaxResult historyNamesPrompt = promptService.prompt(historyNames);
// Object valOrg = prompt.get("data");
// Object valhis = historyNamesPrompt.get("data");
// JSONObject hisVo = JSONObject.parseObject(JSON.toJSONString(valhis));
// JSONObject orgVo = JSONObject.parseObject(JSON.toJSONString(valOrg));
// for (Map.Entry<String, Object> entry : orgVo.entrySet()) {
// if (entry.getValue().getClass().getSimpleName().equals("Integer")){
// entry.setValue(orgVo.getInteger(entry.getKey())+hisVo.getInteger(entry.getKey()));
// }
// }
// return AjaxResult.success(orgVo);
// }
return prompt;
}
@ResponseBody
@ApiOperation(value = "风险提示统计vx", notes = "风险提示统计vx")
@PostMapping("/prompt/statisticsVx")
@CheckToken
public AjaxResult promptVx(@RequestBody SFParams sfParams) {
return promptService.promptVx(sfParams.getCreditCode());
}
@ResponseBody
@ApiOperation(value = "司法涉诉总览统计", notes = "司法涉诉总览统计")
@PostMapping("/caseCount")
@CheckToken
public AjaxResult caseCount(@Validated @RequestBody SFParams sfParams) {
RequestParams requestParams = new RequestParams();
requestParams.setCreditCode(sfParams.getCreditCode());
JSONObject jsonObject1 = basicInformationService.baseinfo2(requestParams);
if (jsonObject1 != null && "2000".equals(jsonObject1.getString("code"))) {
JSONObject data = jsonObject1.getJSONObject("data");
sfParams.setName(data.getString("name"));
}
return promptService.statics(sfParams.getName());
}
@ResponseBody
@ApiOperation(value = "案件类型分布饼状统计", notes = "案件类型分布饼状统计")
@PostMapping("/case/pieShaped")
@CheckToken
public AjaxResult pieShaped(@RequestBody SFParams sfParams) {
RequestParams requestParams = new RequestParams();
requestParams.setCreditCode(sfParams.getCreditCode());
JSONObject jsonObject1 = basicInformationService.baseinfo2(requestParams);
if (jsonObject1 != null && "2000".equals(jsonObject1.getString("code"))) {
JSONObject data = jsonObject1.getJSONObject("data");
sfParams.setName(data.getString("name"));
}
return promptService.pieShaped(sfParams.getName());
}
}