Compare commits
No commits in common. "dev" and "master" have entirely different histories.
|
|
@ -1,23 +0,0 @@
|
|||
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0 Env/production (2026/6/11 16:24:25) App/accident"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
|
||||
const APP_ENV = {
|
||||
antd: {
|
||||
'ant-prefix': 'micro-temp',
|
||||
fontFamily: 'PingFangSC-Regular',
|
||||
colorPrimary: '#1677ff',
|
||||
borderRadius: parseInt('2')
|
||||
},
|
||||
appKey: '',
|
||||
basename: 'accident',
|
||||
API_HOST: ''
|
||||
};
|
||||
APP_ENV.API_HOST = sessionStorage.API_HOST || APP_ENV.API_HOST || window.location.origin;
|
||||
window.process = {
|
||||
env: { app: APP_ENV },
|
||||
NODE_ENV: 'production'
|
||||
};
|
||||
window.__JJB_ENVIRONMENT__ = {
|
||||
API_HOST: APP_ENV.API_HOST,
|
||||
redirect: '',
|
||||
FRAMEWORK: APP_ENV.antd
|
||||
};
|
||||
})();</script><script defer="defer" src="/accident/static/js/736.295d12b4bcb05b6670ea.js"></script><script defer="defer" src="/accident/static/js/603.44740c07c5cf5b81b777.js"></script><script defer="defer" src="/accident/static/js/main.34be42463da25c11818b.js"></script><link href="/accident/static/css/main.d160d67c789db3671cf4.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0 Env/production (2026/6/11 16:24:25) App/accident Version/dev Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>
|
||||
|
|
@ -1 +0,0 @@
|
|||
.header-back{background-color:#fff;border-bottom:1px solid #dcdfe6;margin-bottom:0;padding:10px 20px;position:sticky;top:0;z-index:9}.header-back .action,.header-back .action .back{align-items:center;display:flex}.header-back .action .back{cursor:pointer;font-size:14px;gap:10px}.header-back .action .title{font-size:17px}.micro-temp-table-cell-scrollbar{width:15px}.micro-temp-table-cell .micro-temp-btn-link{padding:0}.micro-temp-pro-table-list-toolbar-container{padding-bottom:16px;padding-top:0!important}body,html{height:100%;width:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{font-weight:500;margin-bottom:.5em;margin-top:0}p{margin-bottom:1em;margin-top:0}abbr[data-original-title],abbr[title]{border-bottom:0;cursor:help;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}address{font-style:normal;line-height:inherit;margin-bottom:1em}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-bottom:1em;margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}pre{margin-bottom:1em;margin-top:0;overflow:auto}figure{margin:0 0 1em}img{border-style:none;vertical-align:middle}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{caption-side:bottom;padding-bottom:.3em;padding-top:.75em;text-align:left}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{border:0;margin:0;min-width:0;padding:0}legend{color:inherit;display:block;font-size:1.5em;line-height:inherit;margin-bottom:.5em;max-width:100%;padding:0;white-space:normal;width:100%}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:none;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{background-color:#feffe6;padding:.2em}.micro-temp-modal-header{border-bottom:1px solid #ccc!important;margin:0 -24px 15px!important;padding:0 24px 15px!important}.micro-temp-modal-footer{text-align:center!important}.search-layout{position:relative}.search-layout:after{background-color:#f1f1f2;bottom:-10px;content:"";height:10px;left:-20px;position:absolute;right:-20px}.search-layout+.table-layout{padding-top:26px!important}.card-layout{background-color:#fff;border-radius:6px}
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"https://gbs-gateway.qhdsafety.com"},production:{javaGitBranch:"<branch-name>",API_HOST:""}},appIdentifier:"accident",contextInject:{appKey:"",fileUrl:"https://jpfz.qhdsafety.com/gbsFileTest/"},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:[]},server:{port:"8030",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,77 +0,0 @@
|
|||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,106 +0,0 @@
|
|||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* isobject <https://github.com/jonschlinkert/isobject>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/** @preserve
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/
|
||||
|
||||
/** @preserve
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"http://192.168.20.100:30140/demo2"},production:{javaGitBranch:"<branch-name>",API_HOST:""}},appIdentifier:"risk",contextInject:{appKey:""},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:[]},server:{port:"8080",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};
|
||||
|
|
@ -18,24 +18,21 @@
|
|||
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^5.6.1",
|
||||
"@ant-design/pro-components": "^2.8.10",
|
||||
"@ant-design/icons": "latest",
|
||||
"@cqsjjb/jjb-common-decorator": "latest",
|
||||
"@cqsjjb/jjb-common-lib": "latest",
|
||||
"@cqsjjb/jjb-dva-runtime": "latest",
|
||||
"@cqsjjb/jjb-react-admin-component": "latest",
|
||||
"ahooks": "^3.9.5",
|
||||
"antd": "^5.27.6",
|
||||
"antd": "latest",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.3.15"
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.19.3",
|
||||
"@cqsjjb/scripts": "2.0.0",
|
||||
"@cqsjjb/scripts": "latest",
|
||||
"@eslint-react/eslint-plugin": "^2.2.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.37.0",
|
||||
|
|
@ -16,7 +16,6 @@ import com.zcloud.accident.dto.AccidentCountQry;
|
|||
import com.zcloud.accident.dto.AccidentPageQry;
|
||||
import com.zcloud.accident.dto.AccidentUpdateCmd;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCorpCountStatCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentExportCO;
|
||||
import com.zcloud.accident.dto.clientobject.EventExportCO;
|
||||
|
|
@ -27,8 +26,6 @@ import lombok.AllArgsConstructor;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -121,14 +118,8 @@ public class AccidentController {
|
|||
}
|
||||
}
|
||||
|
||||
@ApiOperation("按公司统计事件和事故数量")
|
||||
@ApiOperation("按照公司和事故类型统计个数")
|
||||
@PostMapping("/countByCorpinfoAndType")
|
||||
public MultiResponse<AccidentCorpCountStatCO> countByCorpinfoAndType(@RequestBody AccidentCountQry accidentCountQry) {
|
||||
return accidentService.countByCorpinfo(accidentCountQry);
|
||||
}
|
||||
|
||||
@ApiOperation("按照事故类型钻取统计个数")
|
||||
@PostMapping("/countByIncidentType")
|
||||
public MultiResponse<AccidentCountStatCO> countByCorpinfoIdAndIncidentType(@RequestBody AccidentCountQry accidentCountQry) {
|
||||
return accidentService.countByCorpinfoIdAndIncidentType(accidentCountQry);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
package com.zcloud.accident.command.convertor;
|
||||
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCorpCountStatCO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司级事件/事故统计结果转换器
|
||||
*
|
||||
* @Author
|
||||
* @Date
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface AccidentCorpCountStatConvertor {
|
||||
|
||||
AccidentCorpCountStatCO convertToCO(AccidentCorpCountStat stat);
|
||||
|
||||
List<AccidentCorpCountStatCO> convertToCOList(List<AccidentCorpCountStat> stats);
|
||||
}
|
||||
|
|
@ -3,15 +3,11 @@ package com.zcloud.accident.command.query;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.accident.command.convertor.AccidentCoConvertor;
|
||||
import com.zcloud.accident.command.convertor.AccidentCorpCountStatConvertor;
|
||||
import com.zcloud.accident.command.convertor.AccidentCountStatConvertor;
|
||||
import com.zcloud.accident.domain.gateway.AccidentGateway;
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
import com.zcloud.accident.dto.AccidentCountQry;
|
||||
import com.zcloud.accident.dto.AccidentPageQry;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCorpCountStatCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
|
||||
import com.zcloud.accident.persistence.dataobject.AccidentDO;
|
||||
import com.zcloud.accident.persistence.repository.AccidentRepository;
|
||||
|
|
@ -19,10 +15,8 @@ import com.zcloud.gbscommon.utils.PageQueryHelper;
|
|||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -38,7 +32,6 @@ public class AccidentQueryExe {
|
|||
private final AccidentCoConvertor accidentCoConvertor;
|
||||
private final AccidentGateway accidentGateway;
|
||||
private final AccidentCountStatConvertor accidentCountStatConvertor;
|
||||
private final AccidentCorpCountStatConvertor accidentCorpCountStatConvertor;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
|
|
@ -84,34 +77,6 @@ public class AccidentQueryExe {
|
|||
List<AccidentDO> accidentDOs = accidentRepository.listAll(params,menuPerms);
|
||||
return accidentCoConvertor.converDOsToCOs(accidentDOs);
|
||||
}
|
||||
/**
|
||||
* 按公司统计事件和事故数量
|
||||
* @param accidentCountQry 查询条件,包含公司ID列表
|
||||
* @return 统计结果列表
|
||||
*/
|
||||
public MultiResponse<AccidentCorpCountStatCO> countByCorpinfo(AccidentCountQry accidentCountQry) {
|
||||
List<AccidentCorpCountStat> resultList = accidentGateway.countByCorpinfo(accidentCountQry.getCorpinfoIds());
|
||||
List<AccidentCorpCountStatCO> coList = accidentCorpCountStatConvertor.convertToCOList(resultList);
|
||||
// 补全无数据的公司,事件和事故数量为0
|
||||
if (accidentCountQry.getCorpinfoIds() != null) {
|
||||
Set<Long> existIds = new HashSet<>();
|
||||
for (AccidentCorpCountStatCO co : coList) {
|
||||
existIds.add(co.getCorpinfoId());
|
||||
}
|
||||
for (String idStr : accidentCountQry.getCorpinfoIds()) {
|
||||
Long corpinfoId = Long.valueOf(idStr);
|
||||
if (!existIds.contains(corpinfoId)) {
|
||||
AccidentCorpCountStatCO co = new AccidentCorpCountStatCO();
|
||||
co.setCorpinfoId(corpinfoId);
|
||||
co.setEventCount(0L);
|
||||
co.setAccidentCount(0L);
|
||||
coList.add(co);
|
||||
}
|
||||
}
|
||||
}
|
||||
return MultiResponse.of(coList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照corpinfoId和incidentType统计个数
|
||||
* @param accidentCountQry 查询条件,包含公司ID列表
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.zcloud.accident.dto.AccidentCountQry;
|
|||
import com.zcloud.accident.dto.AccidentPageQry;
|
||||
import com.zcloud.accident.dto.AccidentUpdateCmd;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCorpCountStatCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
|
|
@ -73,11 +72,6 @@ public class AccidentServiceImpl implements AccidentServiceI {
|
|||
accidentRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<AccidentCorpCountStatCO> countByCorpinfo(AccidentCountQry accidentCountQry) {
|
||||
return accidentQueryExe.countByCorpinfo(accidentCountQry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<AccidentCountStatCO> countByCorpinfoIdAndIncidentType(AccidentCountQry accidentCountQry) {
|
||||
return accidentQueryExe.countByCorpinfoIdAndIncidentType(accidentCountQry);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.zcloud.accident.dto.AccidentCountQry;
|
|||
import com.zcloud.accident.dto.AccidentPageQry;
|
||||
import com.zcloud.accident.dto.AccidentUpdateCmd;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCorpCountStatCO;
|
||||
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
|
|
@ -41,14 +40,7 @@ public interface AccidentServiceI {
|
|||
void removeBatch(Long[] ids);
|
||||
|
||||
/**
|
||||
* 按公司统计事件和事故数量
|
||||
* @param accidentCountQry 查询条件,包含公司ID列表
|
||||
* @return 统计结果列表
|
||||
*/
|
||||
MultiResponse<AccidentCorpCountStatCO> countByCorpinfo(AccidentCountQry accidentCountQry);
|
||||
|
||||
/**
|
||||
* 按照corpinfoId和incidentType统计个数(钻取)
|
||||
* 按照corpinfoId和incidentType统计个数
|
||||
* @param accidentCountQry 查询条件,包含公司ID列表
|
||||
* @return 统计结果列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
package com.zcloud.accident.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 公司级事件/事故统计结果数据传输对象
|
||||
*
|
||||
* @Author
|
||||
* @Date
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AccidentCorpCountStatCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "公司ID")
|
||||
private Long corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "事件数量")
|
||||
private Long eventCount;
|
||||
|
||||
@ApiModelProperty(value = "事故数量")
|
||||
private Long accidentCount;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.zcloud.accident.domain.gateway;
|
||||
|
||||
import com.zcloud.accident.domain.model.AccidentE;
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -29,14 +28,6 @@ public interface AccidentGateway {
|
|||
Boolean deletedAccidentById(Long id);
|
||||
Boolean deletedAccidentByIds(Long[] id);
|
||||
|
||||
/**
|
||||
* 按公司统计事件和事故数量
|
||||
*
|
||||
* @param corpinfoIds 公司ID列表
|
||||
* @return 统计结果列表
|
||||
*/
|
||||
List<AccidentCorpCountStat> countByCorpinfo(List<String> corpinfoIds);
|
||||
|
||||
/**
|
||||
* 按照corpinfoId和incidentType统计个数
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
package com.zcloud.accident.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 公司级事件/事故统计结果模型
|
||||
* 按公司统计事件(type=1)和事故(type=2)的数量
|
||||
*
|
||||
* @Author
|
||||
* @Date
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AccidentCorpCountStat {
|
||||
private Long corpinfoId;
|
||||
private Long eventCount;
|
||||
private Long accidentCount;
|
||||
}
|
||||
|
|
@ -3,7 +3,6 @@ package com.zcloud.accident.gatewayimpl;
|
|||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.accident.domain.gateway.AccidentGateway;
|
||||
import com.zcloud.accident.domain.model.AccidentE;
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
import com.zcloud.accident.persistence.dataobject.AccidentDO;
|
||||
import com.zcloud.accident.persistence.repository.AccidentRepository;
|
||||
|
|
@ -52,11 +51,6 @@ public class AccidentGatewayImpl implements AccidentGateway {
|
|||
return accidentRepository.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccidentCorpCountStat> countByCorpinfo(List<String> corpinfoIds) {
|
||||
return accidentRepository.countByCorpinfo(corpinfoIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccidentCountStat> countByCorpinfoIdAndIncidentType(List<String> corpinfoIds, Integer eqAccidentType) {
|
||||
return accidentRepository.countByCorpinfoIdAndIncidentType(corpinfoIds,eqAccidentType);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.datascope.annotation.DataScope;
|
||||
import com.jjb.saas.framework.datascope.annotation.DataScopes;
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
import com.zcloud.accident.persistence.dataobject.AccidentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -25,14 +24,6 @@ import java.util.Map;
|
|||
@DataScope(method = "list", menuPerms = "")})
|
||||
public interface AccidentMapper extends BaseMapper<AccidentDO> {
|
||||
|
||||
/**
|
||||
* 按公司统计事件和事故数量
|
||||
*
|
||||
* @param corpinfoIds 公司ID列表
|
||||
* @return 统计结果列表,包含corpinfoId、corpinfoName、eventCount和accidentCount字段
|
||||
*/
|
||||
List<AccidentCorpCountStat> countByCorpinfo(@Param("corpinfoIds") List<String> corpinfoIds);
|
||||
|
||||
/**
|
||||
* 按照corpinfoId和incidentType统计个数
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.zcloud.accident.persistence.repository;
|
||||
|
||||
import com.zcloud.accident.persistence.dataobject.AccidentDO;
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
|
@ -27,14 +26,6 @@ public interface AccidentRepository extends BaseRepository<AccidentDO> {
|
|||
*/
|
||||
List<AccidentDO> listAll(Map<String,Object> params,String menuPerms);
|
||||
|
||||
/**
|
||||
* 按公司统计事件和事故数量
|
||||
*
|
||||
* @param corpinfoIds 公司ID列表
|
||||
* @return 统计结果列表,包含corpinfoId、corpinfoName、eventCount和accidentCount字段
|
||||
*/
|
||||
List<AccidentCorpCountStat> countByCorpinfo(@Param("corpinfoIds") List<String> corpinfoIds);
|
||||
|
||||
/**
|
||||
* 按照corpinfoId和incidentType统计个数
|
||||
*
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import com.zcloud.accident.domain.model.AccidentCorpCountStat;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
import com.zcloud.accident.persistence.dataobject.AccidentDO;
|
||||
import com.zcloud.accident.persistence.mapper.AccidentMapper;
|
||||
|
|
@ -48,11 +47,6 @@ public class AccidentRepositoryImpl extends BaseRepositoryImpl<AccidentMapper, A
|
|||
return accidentMapper.list(params, menuPerms);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccidentCorpCountStat> countByCorpinfo(List<String> corpinfoIds) {
|
||||
return accidentMapper.countByCorpinfo(corpinfoIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccidentCountStat> countByCorpinfoIdAndIncidentType(List<String> corpinfoIds, Integer eqAccidentType) {
|
||||
return accidentMapper.countByCorpinfoIdAndIncidentType(corpinfoIds, eqAccidentType);
|
||||
|
|
|
|||
|
|
@ -71,24 +71,6 @@
|
|||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="countByCorpinfo" resultType="com.zcloud.accident.domain.model.AccidentCorpCountStat">
|
||||
SELECT
|
||||
corpinfo_id,
|
||||
SUM(CASE WHEN type = 1 THEN 1 ELSE 0 END) as event_count,
|
||||
SUM(CASE WHEN type = 2 THEN 1 ELSE 0 END) as accident_count
|
||||
FROM accident
|
||||
<where>
|
||||
and delete_enum = 'FALSE'
|
||||
<if test="corpinfoIds != null and !corpinfoIds.isEmpty() and corpinfoIds.size()>0">
|
||||
AND corpinfo_id IN
|
||||
<foreach collection="corpinfoIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY corpinfo_id
|
||||
</select>
|
||||
|
||||
<select id="countByCorpinfoIdAndIncidentType" resultType="com.zcloud.accident.domain.model.AccidentCountStat">
|
||||
SELECT
|
||||
corpinfo_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue