9687d2f5 dengxuelong

Merge remote-tracking branch 'origin/master'

2 个父辈 59431130 62269c2c
......@@ -86,7 +86,7 @@ public final class ChineseInital {
}
public static void main(String[] args) {
System.out.println("获取拼音首字母:"+getAllFirstLetter("1大中国南昌中大china"));
System.out.println("获取拼音首字母:"+getAllFirstLetter("1-1#进水提升泵"));
}
}
......
package com.skua.modules.quartz.util;
import com.skua.core.util.ConvertUtils;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
......@@ -16,6 +17,22 @@ import java.util.regex.Pattern;
public class BaseUtil {
private static DecimalFormat df = new DecimalFormat("#.00");
/**
* 格式化
* @param obj
* @param defval
* @return
*/
public static String getValue(Object obj ,Double defval ){
Double d = ConvertUtils.getDouble(obj,defval);
if(d.doubleValue() != 0 ){
return df.format( d );
}
return d.toString();
}
/***
* 计算时间的前几个月的月份
* @param month
......
......@@ -28,6 +28,8 @@ public class JTDisplayScreenController {
public Result<List<SysFactoryInfoVO>> factoryList() {
Result<List<SysFactoryInfoVO>> result = new Result<>();
List<SysFactoryInfoVO> list = displayScreenService.getFactoryList();
result.setResult(list);
return result;
}
......
......@@ -55,7 +55,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
List<Map<String, Object>> dataList = masterDB.queryForList(factorySql);
for(Map<String, Object> dataMap : dataList) {
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
factoryInfoVO = new SysFactoryInfoVO(dataMap.get("id")+"",dataMap.get("depart_id").toString(),dataMap.get("depart_name").toString(),dataMap.get("pro_longitude").toString(),dataMap.get("pro_latitude").toString());
factoryInfoVO = new SysFactoryInfoVO(dataMap.get("id")+"",dataMap.get("depart_id").toString(),dataMap.get("depart_name").toString(),dataMap.get("pro_longitude").toString(),dataMap.get("pro_latitude").toString(),1);
factoryInfoMap.put(factoryInfoVO.getDepartId(),factoryInfoVO);
}
//查询部门集合
......@@ -67,7 +67,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
dataList = masterDB.queryForList(dataViewName2119);
for(Map<String, Object> dataMap : dataList) {
factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
if(factoryInfoVO != null ) factoryInfoVO.setCsl_lastDay(dataMap.get("CSL").toString() ) ;
if(factoryInfoVO != null ) factoryInfoVO.setCsl_lastDay( BaseUtil.getValue( dataMap.get("CSL"),0d) ) ;
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
}
//本月处理水量(m³)
......@@ -75,7 +75,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
dataList = masterDB.queryForList(dataViewName2119);
for(Map<String, Object> dataMap : dataList) {
factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
if(factoryInfoVO != null ) factoryInfoVO.setCsl_month(dataMap.get("CSL").toString() ) ;
if(factoryInfoVO != null ) factoryInfoVO.setCsl_month( BaseUtil.getValue( dataMap.get("CSL"),0d) ) ;
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
}
//本年处理水量(万m³)
......@@ -84,14 +84,24 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
for(Map<String, Object> dataMap : dataList) {
factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
if(factoryInfoVO != null ){
factoryInfoVO.setCsl_year(dataMap.get("CSL").toString() ) ;
factoryInfoVO.setCsl_avg_day(DigitalUtils.division( dataMap.get("CSL").toString() ,differenceTime+"" ) );
factoryInfoVO.setCsl_year( BaseUtil.getValue( ConvertUtils.getDouble(dataMap.get("CSL"),0d) / 10000,0d) ) ;
factoryInfoVO.setCsl_avg_day( BaseUtil.getValue( ConvertUtils.getDouble(dataMap.get("CSL"),0d) / differenceTime,0d) );
}
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
}
factoryInfoVOList = new ArrayList(factoryInfoMap.values());
// 添加:中冶数据
factorySql = "select fi.id,fi.depart_id,d.depart_name, fi.pro_longitude,fi.pro_latitude ,d.depart_type from sys_factory_info fi ,sys_depart d where fi.depart_id = d.id and d.depart_type =-1";
List<SysFactoryInfoVO> factroyList = masterDB.query(factorySql, new BeanPropertyRowMapper<SysFactoryInfoVO>(SysFactoryInfoVO.class));
if(factroyList != null ){
factoryInfoVOList.addAll(factroyList);
}
return factoryInfoVOList;
}
/**
* 项目运营情况
* @param departId
......
......@@ -17,6 +17,9 @@ public class SysFactoryInfoVO {
@ApiModelProperty(value = "水厂名称")
private String departId;
@ApiModelProperty(value = "厂站类型")
private Integer departType = 1;
@ApiModelProperty(value = "水厂名称")
private String departName;
......@@ -42,11 +45,12 @@ public class SysFactoryInfoVO {
public SysFactoryInfoVO() {
}
public SysFactoryInfoVO(String id, String departId, String departName, String proLongitude, String proLatitude) {
public SysFactoryInfoVO(String id, String departId, String departName, String proLongitude, String proLatitude,Integer departType) {
this.id = id;
this.departId = departId;
this.departName = departName;
this.proLongitude = proLongitude;
this.proLatitude = proLatitude;
this.departType = departType;
}
}
......
......@@ -11,16 +11,6 @@ import java.util.List;
*/
public interface OperationReportMapper {
/***
* 查询月度生产数据报表
* @param startTime
* @param endTime
* @param lastStartTime
* @param lastEndTime
* @return
*/
List<FReportMonthDataVO> queryReportMonthData(@Param("startTime") String startTime,@Param("endTime") String endTime, @Param("lastStartTime")String lastStartTime,@Param("lastEndTime") String lastEndTime) ;
/***
* 查询隐含排查部门名称
* @return
*/
......
......@@ -2,60 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.report.mapper.OperationReportMapper">
<!-- -->
<select id="queryReportMonthData" resultType="com.skua.modules.report.vo.FReportMonthDataVO">
SELECT
a.depart_id,tc.target_water,tc. target_power,tc.target_drug,
(select t.depart_name from sys_depart t where t.id = a.depart_id ) 'depart_name',
(
select sum(fiv.item_value)/10000 from f_report_itemv fiv ,f_report_item fi
where fi.report_id = '2119ecbf53a1d2d0708258ff67cfd9e1' and item_code= 'CSL' and fiv.reit_id =fi.id and a.depart_id = fiv.depart_id and fiv.data_time like '2024%'
) 'ysjsl',
(
select sum(fiv.item_value)/10000 from f_report_itemv fiv ,f_report_item fi
where fi.report_id = '2119ecbf53a1d2d0708258ff67cfd9e1' and item_code= 'CSL' and fiv.reit_id =fi.id and a.depart_id = fiv.depart_id and fiv.data_time like '2023%'
) 'tqysjsl',
(select sum(fiv.item_value)/10000 from f_report_itemv fiv ,f_report_item fi
where fi.report_id = '3a243d5715b9e1a3753c180872ca0df9' and item_code= 'DLHJ' and fiv.reit_id =fi.id and a.depart_id = fiv.depart_id and fiv.data_time like '2024%' ) 'ydh',
sum( IF ( ( `d`.`item_code` = 'yslwcbl' ), `a`.`item_value`, NULL ) ) AS `yslwcbl`, -- 月水量完成比例
sum( IF ( ( `d`.`item_code` = 'ysjsldyqntqyy' ), `a`.`item_value`, NULL ) ) AS `ysjsldyqntqyy`, -- 月实际水量低于去年同期原因
sum( IF ( ( `d`.`item_code` = 'qntqsfsl' ), `a`.`item_value`, NULL ) ) AS `qntqsfsl`, -- 去年同期收费水量
sum( IF ( ( `d`.`item_code` = 'ysfsl' ), `a`.`item_value`, NULL ) ) AS `ysfsl`, -- 月收费水量
sum( IF ( ( `d`.`item_code` = 'bnsjdh' ), `a`.`item_value`, NULL ) ) AS `bnsjdh`,-- 本年实际电耗
sum( IF ( ( `d`.`item_code` = 'sldyyqyy' ), `a`.`item_value`, NULL ) ) AS `sldyyqyy`,-- 收费水量对比变化率
sum( IF ( ( `d`.`item_code` = 'dhgyqntqyy' ), `a`.`item_value`, NULL ) ) AS `dhgyqntqyy`, -- 电耗高于去年同期原因
sum( IF ( ( `d`.`item_code` = 'yyf' ), `a`.`item_value`, NULL ) ) AS `yyf`, -- 月药费
sum( IF ( ( `d`.`item_code` = 'yhgyqntqyy' ), `a`.`item_value`, NULL ) ) AS `yhgyqntqyy`, -- 药耗高于去年同期原因
sum( IF ( ( `d`.`item_code` = 'dhcmbzyy' ), `a`.`item_value`, NULL ) ) AS `dhcmbzyy`, -- 电耗超目标值原因
sum( IF ( ( `d`.`item_code` = 'yhcyqyy' ), `a`.`item_value`, NULL ) ) AS `yhcyqyy` -- 药耗超预期原因
FROM
( (SELECT reit_id,item_value,depart_id
FROM f_report_itemv
WHERE
data_time LIKE '2024%'
AND reit_id IN (
'1818936216687595521',
'1818936217375461377',
'1818936218109464577',
'1818936218910576642',
'1818936219120291842',
'1818936219854295042',
'1818936220017872897',
'1818936220353417218',
'1818936220571521025',
'1818936220739293185',
'1818936220890288130' )
) `a`
LEFT JOIN `f_report_item` `d` ON ( ( `a`.`reit_id` = `d`.`id` ) )
LEFT JOIN `report_target_config` tc ON ( ( `tc`.`depart_id` = `a`.`depart_id` ) )
)
WHERE
1 = 1
GROUP BY
`a`.`depart_id`
</select>
<select id="queryDepatNameList" resultType="java.lang.String">
select d.depart_name from ajh_rectification_info t
left join sys_depart d on t.depart_id = d.id
......
......@@ -8,12 +8,6 @@ import com.skua.modules.report.vo.ProductDataVO;
*/
public interface IOperationReportService {
/***
* 执行查询sql语句返回一个结果
* @param sql
* @return
*/
String queryForString(String sql );
/***
* 处理月季度数据
......
......@@ -22,6 +22,10 @@ public class FReportPowerMonthDataVO {
@ApiModelProperty(value = "原因分析")
private String causeAnalysis;
public FReportPowerMonthDataVO(){
}
public FReportPowerMonthDataVO(String deptartName, String targetConsume, String realConsume , String causeAnalysis) {
this.deptartName = deptartName;
this.targetConsume = targetConsume;
......
......@@ -19,6 +19,10 @@ public class FReportWaterMonthDataVO {
@ApiModelProperty(value = "原因分析")
private String causeAnalysis;
public FReportWaterMonthDataVO(){
}
public FReportWaterMonthDataVO(String deptartName, String ratio, String causeAnalysis) {
this.deptartName = deptartName;
this.ratio = ratio;
......
package com.skua.modules.report.vo;
import com.skua.core.util.ConvertUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -18,19 +19,22 @@ public class ProductDataVO {
@ApiModelProperty(value = "季度开始时间")
private String startTime;
@ApiModelProperty(value = "季度结束时间")
private String endTime;
@ApiModelProperty(value = "水务厂站数量")
private String deptartCount;
@ApiModelProperty(value = "相差天数")
private Long dayNum;
@ApiModelProperty(value = "收费水量")
private String chargeWaterVolume;//收费水量9854.012552万吨
@ApiModelProperty(value = "收费水量-日均值")
private String avgDayWaterVolume;//平均108.29万吨/天
private Double avgDayWaterVolume;//平均108.29万吨/天
@ApiModelProperty(value = "收费水量-同比增长")
private String chargeWaterRatio;
private Double chargeWaterRatio;
@ApiModelProperty(value = "收费水量-完成率")
private String completeRatio;
private Double completeRatio;
@ApiModelProperty(value = "序时进度")
private String sequentialProgress;
......@@ -39,17 +43,17 @@ public class ProductDataVO {
@ApiModelProperty(value = "实际处理水量")
private String ysjslWaterVolume;
@ApiModelProperty(value = "实际处理水量-日均值")
private String avgYsjslWaterVolume;//平均99.76万吨/天
private Double avgYsjslWaterVolume;//平均99.76万吨/天
@ApiModelProperty(value = "实际处理水量--同比增长")
private String ysjslWaterRatio;
private Double ysjslWaterRatio;
@ApiModelProperty(value = "药量目标")
private String targetDrug;
private Double targetDrug;
@ApiModelProperty(value = "药剂实际费用")
private String drugCost;//实际发生为0.219元/吨水
private Double drugCost;//实际发生为0.219元/吨水
@ApiModelProperty(value = "实际水量同比下降--水务公司列表")
......@@ -76,6 +80,16 @@ public class ProductDataVO {
@ApiModelProperty(value = "隐患部门名称")
private String dangerDeptNames;
//收费水量-日均值
public Double getAvgDayWaterVolume() {
avgDayWaterVolume = ConvertUtils.getDouble(chargeWaterVolume,0) / dayNum ;
return avgDayWaterVolume;
}
//实际处理水量-日均值
public Double getAvgYsjslWaterVolume() {
avgYsjslWaterVolume = ConvertUtils.getDouble(ysjslWaterVolume,0) / dayNum;
return avgYsjslWaterVolume;
}
public String getWaterDeptartName() {
return getDeptName(waterDeptartList);
......@@ -110,3 +124,4 @@ public class ProductDataVO {
return deptName;
}
}
......
package com.skua.modules.report.vo;
import com.skua.tool.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
/**
* 季度时间
* @auther kangwei
......@@ -24,7 +28,7 @@ public class SeasonTimeVO {
@ApiModelProperty(value = "季度结束时间")
private String endTime;
@ApiModelProperty(value = "季度天数")
private String disparityDay;
private Long disparityDay;
public SeasonTimeVO(){
......@@ -38,37 +42,32 @@ public class SeasonTimeVO {
public void getTimeBySeason(int year,int season){
int startMonth = 0;
int endMonth = 0;
int startDay = 1;
int endDay = 31;
switch (season) {
case 1:
startMonth = 1;
endMonth = 3;
break;
case 2:
startMonth = 4;
endMonth = 6;
break;
case 3:
startMonth = 7;
endMonth = 9;
break;
case 4:
startMonth = 10;
endMonth = 12;
break;
default:
System.out.println("季度输入无效,请输入1-4之间的数字。");
case 1: startMonth = 1;endMonth = 3; endDay=31; break;
case 2: startMonth = 4;endMonth = 6; endDay=30; break;
case 3:startMonth = 7;endMonth = 9;endDay=30; break;
case 4: startMonth = 10; endMonth = 12; endDay=31; break;
default:System.out.println("季度输入无效,请输入1-4之间的数字。");return ;
}
Calendar startDate = Calendar.getInstance();
/* startDate.set(Calendar.YEAR,year);
startDate.set(Calendar.MONTH, startMonth-1);
startDate.set(Calendar.DATE, startDay);*/
startDate.set(year,startMonth-1,startDay);
LocalDate startDate = LocalDate.of(year, startMonth, 1);
LocalDate endDate = LocalDate.of(year, endMonth, startDate.lengthOfMonth());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
Calendar endDate = Calendar.getInstance();
/* endDate.set(Calendar.YEAR,year);
endDate.set(Calendar.MONTH, endMonth-1);
endDate.set(Calendar.DATE, endDay);*/
endDate.set(year,endMonth-1,endDay);
this.startTime = startDate.format(formatter);;
this.endTime = endDate.format(formatter); ;
long daysBetween = daysBetween(startDate, endDate);
this.disparityDay = daysBetween+"";
}
public static long daysBetween(LocalDate startDate, LocalDate endDate) {
return ChronoUnit.DAYS.between(startDate, endDate);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
this.startTime = formatter.format(startDate.getTime());
this.endTime = formatter.format(endDate.getTime());
//long daysBetween = daysBetween(this.startTime, this.endTime );
this.disparityDay = DateUtils.differenceDay( this.startTime, this.endTime );
}
}
......
......@@ -34,11 +34,8 @@ import java.util.List;
@EnableSwagger2
@EnableSwaggerBootstrapUI
public class Swagger2Config implements WebMvcConfigurer {
/**
*
* 显示swagger-ui.html文档展示页,还必须注入swagger资源:
*
* @param registry
*/
@Override
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!