Commit 0d0f96d0 authored by 耿迪迪's avatar 耿迪迪
parents 079c9b2a 6ba9feb5
......@@ -226,6 +226,7 @@
<groupId>com.bstek.ureport</groupId>
<artifactId>ureport2-console</artifactId>
<version>2.2.9</version>
<!-- <version>2.3.0-SNAPSHOT</version>-->
</dependency>
</dependencies>
......
......@@ -58,13 +58,13 @@ spring:
# redis 配置
redis:
# 地址
host: 121.29.1.158
host: 36.138.180.82
# 端口,默认为6379
port: 6380
port: 63798
# 数据库索引
database: 0
# 密码
password: 1qaz2wsx3edc
password: 1qaz2wsx3edc@
# 连接超时时间
timeout: 10s
lettuce:
......@@ -90,10 +90,10 @@ zehong:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath
profile: /data/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
captchaType: math
# ureport访问路径-测试
ureporturl: http://127.0.0.1:8905/gassafety
ureporturl: http://36.138.180.82:8905/gassafety
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<import resource="classpath:ureport-console-context.xml" />
<bean id="propertyConfigurer" parent="ureport.props">
<property name="location">
<value>classpath:ureport.properties</value>
</property>
</bean>
<bean id="complainDealServiceImpl" class="com.zehong.system.service.impl.TComplainDealServiceImpl"></bean>
</beans>
\ No newline at end of file
......@@ -78,6 +78,16 @@ public interface ITComplainDealService
public ComplainDealSummaryAnalysisVo complainDealSummaryAnalysisMethod();
/**
*
* @param dataSourceName ureport2配置数据源名称
* @param dataSetName ureport2配置数据集明恒
* @param map 参数map
* @return
*/
public List<ComplainDealSummaryAnalysisTableVo> complainDealSummaryAnalysisMethodTableViewsForUrepore2(String dataSourceName,String dataSetName,Map<String,String> map);
public List<ComplainDealSummaryAnalysisTableVo> complainDealSummaryAnalysisMethodTableViews(ComplainDealSummaryAnalysisTableVo complainDealSummaryAnalysisTableVo);
......
......@@ -33,7 +33,7 @@ import javax.servlet.http.HttpServletResponse;
* @author zehong
* @date 2022-02-15
*/
@Service
@Service("complainDealServiceImpl")
public class TComplainDealServiceImpl implements ITComplainDealService
{
@Autowired
......@@ -640,4 +640,191 @@ public class TComplainDealServiceImpl implements ITComplainDealService
return complainDealSummaryAnalysisVo;
}
/**
*
* @param dataSourceName ureport2配置数据源名称
* @param dataSetName ureport2配置数据集明恒
* @param map 参数map
* @return
*/
@Override
public List<ComplainDealSummaryAnalysisTableVo> complainDealSummaryAnalysisMethodTableViewsForUrepore2(String dataSourceName,String dataSetName,Map<String,String> map) {
String date = map.get("date");
String complaintCategory = map.get("complaintCategory");
// 管理制度
List<TComplainDealManSysSet> tComplainDealManSysSets = tComplainDealManSysSetMapper.selectTComplainDealManSysSetList(new TComplainDealManSysSet());
//1-投诉举报 管理制度时间
long fType1 = 0;
//2-服务申请 管理制度时间
long fType2 = 0;
//3-咨询建议 管理制度时间
long fType3 = 0;
//总发生量
BigDecimal totalAmount = BigDecimal.ZERO;
//总办结量
BigDecimal totalCompletionRate = BigDecimal.ZERO;
//总及时办结量
BigDecimal totalTimelyCompletionRate = BigDecimal.ZERO;
for (TComplainDealManSysSet tComplainDealManSysSet : tComplainDealManSysSets) {
Long days = tComplainDealManSysSet.getfDay();
Long hours = tComplainDealManSysSet.getfHours();
Long minutes = tComplainDealManSysSet.getfMinutes();
Long seconds = tComplainDealManSysSet.getfSeconds();
Long allTime = days * 24L * 60 * 60 * 1000
+ hours * 60 * 60 * 1000
+ minutes * 60 * 1000
+ seconds * 1000;
if ("1".equals(tComplainDealManSysSet.getfType())) {
fType1= allTime;
} else if ("2".equals(tComplainDealManSysSet.getfType())) {
fType2= allTime;
} else if ("3".equals(tComplainDealManSysSet.getfType())) {
fType3 = allTime;
}
}
if(StringUtils.isEmpty(date)) {
return initEmptyList();
}
//查询当前年的开始时间和结束时间
Date startOfMonth = DateUtils.parseDate(date + "-01-01 00:00:00");
Date endOfMonth = DateUtils.parseDate(date + "-12-31 23:59:59");
//所有所有发生的投诉
List<TComplainDealDTO> tComplainDeals = tComplainDealMapper.queryAllByNotDeleteAndCreateTime(startOfMonth,endOfMonth,complaintCategory);
List<ComplainDealSummaryAnalysisTableVo> complainDealSummaryAnalysisTableVos = new ArrayList<>();
//先初始化一个空的,然后再循环往里面放值
List<ComplainDealSummaryAnalysisTableVo> complainDealSummaryAnalysisTableVosEmpty = initEmptyList();
//如果没数据,就返回一个都是null的数据的集合
if(tComplainDeals.size() == 0) {
return complainDealSummaryAnalysisTableVosEmpty;
}
Map<String, List<TComplainDealDTO>> collect = tComplainDeals.stream().collect(Collectors.groupingBy(TComplainDealDTO::getCreateTimeYear));
ComplainDealSummaryAnalysisTableVo complainDealSummaryAnalysisTableVo1;
for (Map.Entry<String, List<TComplainDealDTO>> stringListEntry : collect.entrySet()) {
String key = stringListEntry.getKey();
List<TComplainDealDTO> value = stringListEntry.getValue();
BigDecimal count = new BigDecimal(value.size());
// 发生量统计
totalAmount = totalAmount.add(count);
complainDealSummaryAnalysisTableVo1 = new ComplainDealSummaryAnalysisTableVo();
complainDealSummaryAnalysisTableVo1.setDate(key + "月");
// 发生量
complainDealSummaryAnalysisTableVo1.setAmount(value.size() + "");
// 如果有发生量
if (value.size() > 0) {
//办结率
List<TComplainDealDTO> completionRateCollect = value.stream().filter(item -> "3".equals(item.getComplainStatus())).collect(Collectors.toList());
if (completionRateCollect.size() == 0) {
complainDealSummaryAnalysisTableVo1.setCompletionRate("0");
} else {
BigDecimal completedCount = new BigDecimal(completionRateCollect.size());
BigDecimal divide = completedCount.multiply(new BigDecimal(100)).divide(count, 2, BigDecimal.ROUND_HALF_UP);
//统计 发生率
totalCompletionRate = totalCompletionRate.add(completedCount);
complainDealSummaryAnalysisTableVo1.setCompletionRate(divide.toString());
}
// 及时办结率
if( completionRateCollect.size() == 0) {
complainDealSummaryAnalysisTableVo1.setTimelyCompletionRate("0");
} else {
int timelyCompletionRateInt = 0;
for (TComplainDealDTO tComplainDealDTO : completionRateCollect) {
String complainType = tComplainDealDTO.getComplainType();
Date createTime = tComplainDealDTO.getCreateTime();
Date updateTime = tComplainDealDTO.getUpdateTime();
if (complainType != null && !"".equals(complainType)
&& createTime != null && updateTime != null) {
long diff = updateTime.getTime() - createTime.getTime();
// 是类型1 并且小于 类型1的管理制度
if ("1".equals(complainType)) {
if (diff - fType1 < 0) {
timelyCompletionRateInt ++;
}
} else if ("2".equals(complainType)) {
if (diff - fType2 < 0) {
timelyCompletionRateInt ++;
}
} else if ("3".equals(complainType)) {
if (diff - fType3 < 0) {
timelyCompletionRateInt ++;
}
}
}
}
if (timelyCompletionRateInt > 0) {
BigDecimal CompletionRateIntDecimal = new BigDecimal(timelyCompletionRateInt);
BigDecimal divide = CompletionRateIntDecimal.multiply(new BigDecimal(100)).divide(count, 2, BigDecimal.ROUND_HALF_UP);
//统计 及时办结率
totalTimelyCompletionRate = totalTimelyCompletionRate.add(CompletionRateIntDecimal);
complainDealSummaryAnalysisTableVo1.setTimelyCompletionRate(divide.toString());
} else {
complainDealSummaryAnalysisTableVo1.setTimelyCompletionRate("0");
}
}
// 如果没有发生量则别的都是0
} else {
complainDealSummaryAnalysisTableVo1.setCompletionRate("0");
complainDealSummaryAnalysisTableVo1.setTimelyCompletionRate("0");
}
complainDealSummaryAnalysisTableVos.add(complainDealSummaryAnalysisTableVo1);
}
// 如果有数据,则往 empty集合里面放值
if (complainDealSummaryAnalysisTableVos.size() > 0) {
for (int i = 0; i < complainDealSummaryAnalysisTableVosEmpty.size(); i++) {
ComplainDealSummaryAnalysisTableVo dealSummaryAnalysisTableVo = complainDealSummaryAnalysisTableVosEmpty.get(i);
for (ComplainDealSummaryAnalysisTableVo summaryAnalysisTableVo : complainDealSummaryAnalysisTableVos) {
if (dealSummaryAnalysisTableVo.getDate().equals(summaryAnalysisTableVo.getDate())) {
dealSummaryAnalysisTableVo.setAmount(summaryAnalysisTableVo.getAmount());
dealSummaryAnalysisTableVo.setCompletionRate(summaryAnalysisTableVo.getCompletionRate());
dealSummaryAnalysisTableVo.setTimelyCompletionRate(summaryAnalysisTableVo.getTimelyCompletionRate());
}
}
//说明是 统计
if (i == 12 ) {
dealSummaryAnalysisTableVo.setAmount(totalAmount.toString());
// 统计 办结率
BigDecimal divide = totalCompletionRate.multiply(new BigDecimal(100)).divide(totalAmount, 2, BigDecimal.ROUND_HALF_UP);
dealSummaryAnalysisTableVo.setCompletionRate(divide.toString());
// 统计 及时办结率
BigDecimal divide1 = totalTimelyCompletionRate.multiply(new BigDecimal(100)).divide(totalAmount, 2, BigDecimal.ROUND_HALF_UP);
dealSummaryAnalysisTableVo.setTimelyCompletionRate(divide1.toString());
}
}
}
return complainDealSummaryAnalysisTableVosEmpty;
}
}
<template>
<div v-loading="loading" :style="'height:'+ height">
<iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto"/>
</div>
</template>
<script>
export default {
name: "Ureport",
data() {
return {
// src: "http://36.138.180.82:8905/gassafety/ureport/preview?_u=file:按条件查询报表测试.ureport.xml&_t=2,9,3&date=2024&complaintCategory=0",
src: "http://localhost:8905/gassafety/ureport/preview?_u=file:按条件查询报表测试.ureport.xml&_t=2,9,3&date=2024&complaintCategory=0",
height: document.documentElement.clientHeight - 94.5 + "px;",
loading: true
};
},
mounted: function() {
setTimeout(() => {
this.loading = false;
}, 230);
const that = this;
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 94.5 + "px;";
};
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment