15 changed files with 514 additions and 1049 deletions
@ -0,0 +1,45 @@ |
|||
package irbs.cust.rating.controller; |
|||
|
|||
import irbs.cust.rating.jpa.support.KeyValueWrapper; |
|||
import irbs.cust.rating.service.HomeService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 首页控制器 |
|||
* @author likunming |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/api/irbs/home") |
|||
public class HomeController { |
|||
|
|||
@Autowired |
|||
private HomeService homeService; |
|||
|
|||
/** |
|||
* 首页,敞口分布统计 |
|||
* |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@RequestMapping(value = "ratingModelExposure", method = RequestMethod.GET) |
|||
@ResponseBody |
|||
public List<KeyValueWrapper> ratingModelExposure() throws Exception { |
|||
return homeService.getRatingModelExposureList(); |
|||
} |
|||
|
|||
/** |
|||
* 首页,评级分布统计 |
|||
* |
|||
* @throws Exception 异常 |
|||
*/ |
|||
@RequestMapping(value = "ratingLevelExposure", method = RequestMethod.GET) |
|||
@ResponseBody |
|||
public List<KeyValueWrapper> ratingLevelExposureList() throws Exception { |
|||
return homeService.getRatingLevelExposureList(); |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
package irbs.cust.rating.jpa.support; |
|||
|
|||
public class KeyValueWrapper { |
|||
|
|||
private String key; |
|||
private String value; |
|||
|
|||
public String getKey() { |
|||
return key; |
|||
} |
|||
|
|||
public void setKey(String key) { |
|||
this.key = key; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public void setValue(String value) { |
|||
this.value = value; |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
package irbs.cust.rating.service; |
|||
|
|||
import irbs.cust.rating.jpa.support.KeyValueWrapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户评级流程处理服务 |
|||
* @author likunming |
|||
* |
|||
*/ |
|||
public interface HomeService { |
|||
|
|||
public List<KeyValueWrapper> getRatingModelExposureList() throws Exception; |
|||
|
|||
public List<KeyValueWrapper> getRatingLevelExposureList() throws Exception; |
|||
} |
@ -0,0 +1,52 @@ |
|||
package irbs.cust.rating.service.impl; |
|||
|
|||
import irbs.cust.rating.jpa.support.KeyValueWrapper; |
|||
import irbs.cust.rating.service.HomeService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class HomeServiceImpl implements HomeService { |
|||
|
|||
@Autowired |
|||
NamedParameterJdbcTemplate namedParameterJdbcTemplate; |
|||
|
|||
@Override |
|||
public List<KeyValueWrapper> getRatingModelExposureList() throws Exception { |
|||
String querySql = "select MODEL_NAME, count(*) MODEL_NUMBER from NS_COMPANY_RATING where MODEL_CODE IS NOT NULL "; |
|||
querySql += " group by MODEL_CODE, MODEL_NAME order by CAST(substr(MODEL_CODE,4) as DECIMAL) asc "; |
|||
List<KeyValueWrapper> query = namedParameterJdbcTemplate.query(querySql, |
|||
(rs, rowNum) -> { |
|||
KeyValueWrapper kv = new KeyValueWrapper(); |
|||
kv.setKey(rs.getString("MODEL_NAME")); |
|||
kv.setValue(rs.getString("MODEL_NUMBER")); |
|||
return kv; |
|||
}); |
|||
return query; |
|||
} |
|||
|
|||
@Override |
|||
public List<KeyValueWrapper> getRatingLevelExposureList() throws Exception { |
|||
String querySql1 = "select p.FINAL_LEVEL,count(*) FINAL_NUMBER from (" + |
|||
"select distinct(cust_no) as cust_no,FINAL_LEVEL from NS_COMPANY_RATING " + |
|||
"WHERE cust_no is not null and FINAL_LEVEL IS NOT NULL AND RATING_STATUS = '010' "; |
|||
String querySql2 = "select 'D' FINAL_LEVEL, COUNT(*) FINAL_NUMBER from (" + |
|||
"select distinct(cust_no) as cust_no from P_IRS_DEFAULT_COGNIZANCE " + |
|||
"where ((VALID = '1' and DEFAULT_TYPE ='02') or (VALID <> '0' and DEFAULT_TYPE = '01')) and cust_no is not null "; |
|||
querySql1 += ") p GROUP BY p.FINAL_LEVEL"; |
|||
querySql2 += ") q"; |
|||
String querySql = querySql1 + " UNION ALL " + querySql2; |
|||
List<KeyValueWrapper> query = namedParameterJdbcTemplate.query(querySql, |
|||
(rs, rowNum) -> { |
|||
KeyValueWrapper kv = new KeyValueWrapper(); |
|||
kv.setKey(rs.getString("FINAL_LEVEL")); |
|||
kv.setValue(rs.getString("FINAL_NUMBER")); |
|||
return kv; |
|||
}); |
|||
return query; |
|||
} |
|||
} |
@ -1,106 +1,105 @@ |
|||
{ |
|||
"name": "irbs.frontend", |
|||
"version": "8.1.27", |
|||
"description": "", |
|||
"private": false, |
|||
"keywords": [ |
|||
|
|||
], |
|||
"author": "", |
|||
"license": "ISC", |
|||
"scripts": { |
|||
"clean": "rm -rf ./node_modules && rm -rf pnpm-lock.yaml", |
|||
"dev": "nodemon", |
|||
"serve": "node ./util-components-generator.cjs && cross-env NODE_ENV=development webpack serve --config webpack.env.serve.cjs", |
|||
"build": "node ./util-components-generator.cjs && cross-env NODE_ENV=development webpack --config webpack.env.build.cjs", |
|||
"prod": "node ./util-components-generator.cjs && cross-env NODE_ENV=production webpack --config webpack.env.prod.cjs", |
|||
"sync": "platform sync" |
|||
}, |
|||
"engines": { |
|||
"node": ">=18", |
|||
"pnpm": ">=7" |
|||
}, |
|||
"publishConfig": { |
|||
"registry": "http://nexus.sc.io:8000/repository/npm-releases/", |
|||
"access": "public" |
|||
}, |
|||
"devDependencies": { |
|||
"@babel/core": "7.23.7", |
|||
"@babel/preset-env": "7.23.7", |
|||
"@babel/preset-typescript": "7.23.3", |
|||
"@babel/plugin-transform-class-properties": "7.23.3", |
|||
"@babel/plugin-transform-object-rest-spread": "7.23.4", |
|||
"@quasar/app-webpack": "3.12.1", |
|||
"@quasar/cli": "2.3.0", |
|||
"@types/mockjs": "1.0.10", |
|||
"@types/node": "20.10.6", |
|||
"@typescript-eslint/eslint-plugin": "6.17.0", |
|||
"@typescript-eslint/parser": "6.17.0", |
|||
"@vue/compiler-sfc": "3.4.3", |
|||
"@webpack-cli/serve": "2.0.5", |
|||
"autoprefixer": "10.4.16", |
|||
"babel-loader": "9.1.3", |
|||
"clean-webpack-plugin": "4.0.0", |
|||
"copy-webpack-plugin": "11.0.0", |
|||
"cross-env": "7.0.3", |
|||
"css-loader": "6.8.1", |
|||
"eslint": "8.56.0", |
|||
"eslint-config-prettier": "9.1.0", |
|||
"eslint-plugin-prettier": "5.1.2", |
|||
"eslint-plugin-vue": "9.19.2", |
|||
"eslint-webpack-plugin": "4.0.1", |
|||
"html-webpack-plugin": "5.6.0", |
|||
"json5": "2.2.3", |
|||
"mini-css-extract-plugin": "2.7.6", |
|||
"nodemon": "3.0.2", |
|||
"postcss": "8.4.32", |
|||
"postcss-import": "16.0.0", |
|||
"postcss-loader": "7.3.4", |
|||
"postcss-preset-env": "9.3.0", |
|||
"prettier": "3.1.1", |
|||
"sass": "1.69.7", |
|||
"sass-loader": "13.3.3", |
|||
"typescript": "5.3.3", |
|||
"vue-loader": "17.4.2", |
|||
"webpack": "5.89.0", |
|||
"webpack-bundle-analyzer": "4.10.1", |
|||
"webpack-cli": "5.1.4", |
|||
"webpack-dev-server": "4.15.1", |
|||
"webpack-merge": "5.10.0", |
|||
"@vue/babel-plugin-jsx": "1.1.5" |
|||
}, |
|||
"dependencies": { |
|||
"@quasar/extras": "1.16.9", |
|||
"@vueuse/core": "10.7.1", |
|||
"axios": "1.6.3", |
|||
"dayjs": "1.11.10", |
|||
"echarts": "5.4.3", |
|||
"exceljs": "4.4.0", |
|||
"file-saver": "2.0.5", |
|||
"luckyexcel": "1.0.1", |
|||
"mockjs": "1.1.0", |
|||
"pinia": "2.1.7", |
|||
"platform-core": "8.1.188", |
|||
"quasar": "2.14.2", |
|||
"tailwindcss": "3.4.0", |
|||
"vue": "3.4.3", |
|||
"vue-dompurify-html": "5.0.1", |
|||
"vue-i18n": "9.8.0", |
|||
"vue-router": "4.2.5", |
|||
"lodash": "4.17.21", |
|||
"@codemirror/autocomplete": "6.11.1", |
|||
"@codemirror/commands": "6.3.3", |
|||
"@codemirror/lang-html": "6.4.7", |
|||
"@codemirror/lang-java": "6.0.1", |
|||
"@codemirror/lang-javascript": "6.2.1", |
|||
"@codemirror/lang-json": "6.0.1", |
|||
"@codemirror/lang-sql": "6.5.4", |
|||
"@codemirror/lang-xml": "6.0.2", |
|||
"@codemirror/language": "6.10.0", |
|||
"@codemirror/search": "6.5.5", |
|||
"@codemirror/state": "6.4.0", |
|||
"@codemirror/view": "6.23.0", |
|||
"codemirror": "6.0.1", |
|||
"vue-codemirror6": "1.2.0" |
|||
} |
|||
} |
|||
"name": "irbs.frontend", |
|||
"version": "1.0.1", |
|||
"description": "", |
|||
"private": false, |
|||
"keywords": [], |
|||
"author": "", |
|||
"license": "ISC", |
|||
"scripts": { |
|||
"clean": "rm -rf ./node_modules && rm -rf pnpm-lock.yaml", |
|||
"dev": "nodemon", |
|||
"serve": "node ./util-components-generator.cjs && cross-env NODE_ENV=development webpack serve --config webpack.env.serve.cjs", |
|||
"build": "node ./util-components-generator.cjs && cross-env NODE_ENV=development webpack --config webpack.env.build.cjs", |
|||
"prod": "node ./util-components-generator.cjs && cross-env NODE_ENV=production webpack --config webpack.env.prod.cjs", |
|||
"sync": "platform sync" |
|||
}, |
|||
"engines": { |
|||
"node": ">=18", |
|||
"pnpm": ">=7" |
|||
}, |
|||
"publishConfig": { |
|||
"registry": "http://nexus.sc.io:8000/repository/npm-releases/", |
|||
"access": "public" |
|||
}, |
|||
"devDependencies": { |
|||
"@babel/core": "7.24.4", |
|||
"@babel/preset-env": "7.24.4", |
|||
"@babel/preset-typescript": "7.24.1", |
|||
"@babel/plugin-transform-class-properties": "7.24.1", |
|||
"@babel/plugin-transform-object-rest-spread": "7.24.1", |
|||
"@quasar/app-webpack": "3.12.5", |
|||
"@quasar/cli": "2.4.0", |
|||
"@types/mockjs": "1.0.10", |
|||
"@types/node": "20.12.7", |
|||
"@typescript-eslint/eslint-plugin": "7.7.1", |
|||
"@typescript-eslint/parser": "7.7.1", |
|||
"@vue/compiler-sfc": "3.4.24", |
|||
"@webpack-cli/serve": "2.0.5", |
|||
"autoprefixer": "10.4.19", |
|||
"babel-loader": "9.1.3", |
|||
"clean-webpack-plugin": "4.0.0", |
|||
"copy-webpack-plugin": "12.0.2", |
|||
"cross-env": "7.0.3", |
|||
"css-loader": "7.1.1", |
|||
"eslint": "8.56.0", |
|||
"eslint-config-prettier": "9.1.0", |
|||
"eslint-plugin-prettier": "5.1.3", |
|||
"eslint-plugin-vue": "9.25.0", |
|||
"eslint-webpack-plugin": "4.1.0", |
|||
"html-webpack-plugin": "5.6.0", |
|||
"json5": "2.2.3", |
|||
"mini-css-extract-plugin": "2.9.0", |
|||
"nodemon": "3.1.0", |
|||
"postcss": "8.4.38", |
|||
"postcss-import": "16.1.0", |
|||
"postcss-loader": "8.1.1", |
|||
"postcss-preset-env": "9.5.9", |
|||
"prettier": "3.2.5", |
|||
"sass": "1.75.0", |
|||
"sass-loader": "14.2.1", |
|||
"typescript": "5.4.5", |
|||
"vue-loader": "17.4.2", |
|||
"webpack": "5.91.0", |
|||
"webpack-bundle-analyzer": "4.10.2", |
|||
"webpack-cli": "5.1.4", |
|||
"webpack-dev-server": "5.0.4", |
|||
"webpack-merge": "5.10.0", |
|||
"@vue/babel-plugin-jsx": "1.2.2" |
|||
}, |
|||
"dependencies": { |
|||
"@quasar/extras": "1.16.11", |
|||
"@vueuse/core": "10.9.0", |
|||
"axios": "1.6.8", |
|||
"dayjs": "1.11.10", |
|||
"echarts": "5.5.0", |
|||
"exceljs": "4.4.0", |
|||
"file-saver": "2.0.5", |
|||
"luckyexcel": "1.0.1", |
|||
"mockjs": "1.1.0", |
|||
"pinia": "2.1.7", |
|||
"platform-core": "8.1.217", |
|||
"quasar": "2.15.3", |
|||
"tailwindcss": "3.4.3", |
|||
"vue": "3.4.24", |
|||
"vue-dompurify-html": "5.0.1", |
|||
"vue-i18n": "9.13.1", |
|||
"vue-router": "4.3.2", |
|||
"lodash": "4.17.21", |
|||
"@codemirror/autocomplete": "6.16.0", |
|||
"@codemirror/commands": "6.5.0", |
|||
"@codemirror/lang-html": "6.4.9", |
|||
"@codemirror/lang-java": "6.0.1", |
|||
"@codemirror/lang-javascript": "6.2.2", |
|||
"@codemirror/lang-json": "6.0.1", |
|||
"@codemirror/lang-sql": "6.6.3", |
|||
"@codemirror/lang-xml": "6.1.0", |
|||
"@codemirror/language": "6.10.1", |
|||
"@codemirror/search": "6.5.6", |
|||
"@codemirror/state": "6.4.1", |
|||
"@codemirror/view": "6.26.3", |
|||
"codemirror": "6.0.1", |
|||
"vue-codemirror6": "1.2.0", |
|||
"@maxgraph/core": "0.10.0" |
|||
} |
|||
} |
File diff suppressed because it is too large
Loading…
Reference in new issue