86b6e998 康伟

kangwei: 提交“指标中心”后端接口

1 个父辈 beb320ec
正在显示 27 个修改的文件 包含 657 行增加3 行删除
......@@ -86,8 +86,8 @@ public class ReportViewUtil {
* @param reportId 报表id
* @param fields 查询字段
* @param departIds 厂站集合
* @param startTime 开始时间
* @param endTime 结束时间
* @param dataTime 开始时间
* @param dataTime 结束时间
* @return
* @author Li Yuanyuan, 2021年2月26日 上午10:23:06
*/
......
......@@ -2,6 +2,7 @@ package com.skua.tool.util;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -36,6 +37,28 @@ public class DigitalUtils {
}
/**
* 除法 保留两位小数
* @param dividend 请输入被除数
* @param divisor 请输入除数
* @return
*/
public static String division(String dividend , String divisor ){
String resultStr = "0";
if( dividend != null && dividend.length()>0 && divisor != null && divisor.length()>0){
double dividendD = Double.parseDouble(dividend);
double divisorD = Double.parseDouble(divisor);
double result = dividendD /divisorD;
BigDecimal bd = new BigDecimal(result);
BigDecimal roundedResult = bd.setScale(2, BigDecimal.ROUND_HALF_UP);System.out.println(roundedResult);
resultStr = roundedResult.toString();
}
//System.out.print("请输入被除数:");double dividend =scanner.nextDouble();
// System.out.print("请输入除数:");double divisor =scanner.nextDouble();
return resultStr;
}
/**
* 判断字符串是否是数字类型
*
* @param str
......
......@@ -99,6 +99,30 @@ public class SysAlgorithmStatisticsLibraryController {
return result;
}
@AutoLog(value = "统计功能配置表-统计计算")
@ApiOperation(value="统计功能配置表-统计计算", notes="统计功能配置表-统计计算")
@PostMapping(value = "/statistics/waterData")
public Result<SysAlgorithmStatisticsResultVO> statisticsByWaterData(@RequestBody JSONObject jsonObject,
HttpServletRequest req) throws Exception {
Result<SysAlgorithmStatisticsResultVO> result = new Result<>();
//将jsonObject转sysAlgorithmStatisticsLibraryVO对象
SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
//将jsonObject转Map对象
Map<String,Object> paramMap = JSONObject.toJavaObject(jsonObject,Map.class);
//将paramMap集合去掉SysAlgorithmStatisticsLibraryVO对象内容
Map<String,Object> sysAlgorithmStatisticsLibraryVOMap = JSON.parseObject(JSON.toJSONString(sysAlgorithmStatisticsLibraryVO), new TypeReference<Map<String, Object>>() {});
//Maps.difference(Map, Map)用来比较两个Map以获取所有不同点
MapDifference<String, Object> difference = Maps.difference(paramMap, sysAlgorithmStatisticsLibraryVOMap);
// 键只存在于左边Map的映射项
paramMap = difference.entriesOnlyOnLeft();
SysAlgorithmStatisticsResultVO vo = sysAlgorithmStatisticsLibraryService.statistics(sysAlgorithmStatisticsLibraryVO,paramMap);
//todo 演示暂时注释
result.setSuccess(true);
result.setResult(vo);
return result;
}
/**
* 添加
* @param sysAlgorithmStatisticsLibrary
......
package com.skua.modules.algorithm.service;
import com.skua.modules.report.entity.FReportItemv;
import com.skua.modules.report.vo.DepartLoadRateVO;
import java.util.List;
/**
* <pre>
* 指挥中心实现逻辑
* </pre>
* @author 康伟
* @version V0.1, 2024年9月3日
*/
public interface ICommandCentreService {
/**
* 指挥中心---运行负荷率分析
* @param loadRateType
* @return
*/
public List<DepartLoadRateVO> statisticsByLoadRate(Integer loadRateType);
/**
* 指挥中心---运行负荷率分析 总数查询
* @param loadRateType
* @return
*/
public int statisticsByLoadRateNum(int loadRateType);
/**
* 根据reitId与时间查询
* @param reportId
* @param startDate
* @param endDate
* @return
*/
public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate);
/**
* 根据reitId查询近7天数据
* @param reportId
* @param reportItemCode
* @param dateTime
* @return
*/
public List<String> getReportItemvByReitIdAndDate7Day(String reportId, String reportItemCode, String dateTime);
}
......@@ -23,6 +23,8 @@ public interface ISysAlgorithmStatisticsLibraryService extends IService<SysAlgor
*/
SysAlgorithmStatisticsResultVO statistics(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap) throws Exception;
SysAlgorithmStatisticsResultVO statisticsDayAndFill(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap, SysAlgorithmStatisticsLibrary sysAlgorithmStatisticsLibrary) throws Exception;
SysAlgorithmStatisticsResultVO statisticsHour(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap,SysAlgorithmStatisticsLibrary sysAlgorithmStatisticsLibrary) throws Exception;
......
package com.skua.modules.algorithm.service.impl;
import com.skua.modules.algorithm.service.ICommandCentreService;
import com.skua.modules.report.entity.FReportItemv;
import com.skua.modules.report.mapper.FReportItemMapper;
import com.skua.modules.report.vo.DepartLoadRateVO;
import com.skua.modules.report.mapper.FReportItemvMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <pre>
* 指挥中心实现逻辑
* </pre>
* @author 康伟
* @version V0.1, 2024年9月3日
*/
@Service
public class CommandCentreServiceImpl implements ICommandCentreService {
@Resource
private FReportItemvMapper fReportItemvMapper;
@Resource
private FReportItemMapper reportItemMapper;
/**
* 指挥中心---运行负荷率分析
* @param loadRateType
* @return
*/
public List<DepartLoadRateVO> statisticsByLoadRate(Integer loadRateType){
return fReportItemvMapper.statisticsByLoadRate(loadRateType);
}
/**
* 指挥中心---运行负荷率分析 总数查询
* @param loadRateType
* @return
*/
public int statisticsByLoadRateNum(int loadRateType){
return fReportItemvMapper.statisticsByLoadRateNum(loadRateType);
}
/**
* 根据reitId与时间查询
* @param reportId
* @param startDate
* @param endDate
* @return
*/
public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate){
//根据reportId 与reportItemCode 查询reitId;
List<String> reitIdList = reportItemMapper.getReportItemId(reportId,reportItemCode);
FReportItemv reportItemv = null;
if(reitIdList != null ){
reportItemv = fReportItemvMapper.getReportItemvByReitIdAndDate(reitIdList.get(0) , startDate , endDate);
}
return reportItemv;
}
/**
* 根据reitId查询近7天数据
* @param reportId
* @param reportItemCode
* @param dateTime
* @return
*/
public List<String> getReportItemvByReitIdAndDate7Day(String reportId, String reportItemCode, String dateTime){
//根据reportId 与reportItemCode 查询reitId;
List<String> reitIdList = reportItemMapper.getReportItemId(reportId,reportItemCode);
List<String> dataList = null;
if(reitIdList != null ){
dataList = fReportItemvMapper.getReportItemvByReitIdAndDate7Day(reitIdList.get(0) , dateTime);
}
return dataList;
}
}
......@@ -16,6 +16,8 @@ import com.skua.modules.algorithm.service.ISysAlgorithmLibraryService;
import com.skua.modules.algorithm.service.ISysAlgorithmStatisticsLibraryService;
import com.skua.modules.algorithm.vo.*;
import com.skua.modules.flow.utils.StringUtil;
import com.skua.modules.report.mapper.FReportItemMapper;
import com.skua.modules.report.mapper.FReportItemvMapper;
import com.skua.modules.system.entity.SysDepart;
import com.skua.modules.system.service.ISysDepartService;
import org.apache.commons.lang3.StringUtils;
......@@ -24,6 +26,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.NumberFormat;
import java.util.*;
import java.util.concurrent.Callable;
......@@ -45,6 +48,7 @@ public class SysAlgorithmStatisticsLibraryServiceImpl extends ServiceImpl<SysAlg
private ThreadPoolTaskExecutor taskExecutor;
private static NumberFormat numberFormat;
static {
numberFormat = NumberFormat.getInstance();
numberFormat.setGroupingUsed(false);
......
package com.skua.modules.algorithm.vo;
import com.skua.modules.report.vo.DepartLoadRateVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 指挥中心--部门运行负荷率接受对象
*/
@Data
@ApiModel(value="指挥中心--部门运行负荷率接受对象", description="指挥中心--部门运行负荷率接受对象")
public class DepartLoadRateResultVO implements Serializable{
@ApiModelProperty(value = "正常负荷数")
private Integer normalNum;
@ApiModelProperty(value = "低负荷数")
private Integer lowLoadNum;
@ApiModelProperty(value = "超负荷数")
private Integer overloadNum;
@ApiModelProperty(value = "部门运行负荷率列表")
private List<DepartLoadRateVO> departLoadRateVOList;
}
package com.skua.modules.algorithm.vo;
import com.skua.modules.report.vo.DepartLoadRateVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 指挥中心--部门运行负荷率接受对象
*/
@Data
@ApiModel(value="指挥中心--污水处理趋势", description="指挥中心--污水处理趋势")
public class StackedAreaChartDataVO implements Serializable {
//电集合
@ApiModelProperty(value = "电集合")
List<String> electricityList;
//水集合
@ApiModelProperty(value = "水集合")
List<String> waterList ;
//电耗集合
@ApiModelProperty(value = "电耗集合")
List<String> consumeList = null;
@ApiModelProperty(value = "日历集合")
List<String> dateList;
}
......@@ -65,4 +65,15 @@ public class SysAlgorithmStatisticsLibraryVO {
@Excel(name = "是否查询子机构(0:不是,1:是)", width = 15)
@ApiModelProperty(value = "是否查询子机构(0:不是,1:是)")
private java.lang.String isChildDepart;
/**报表选项code*/
@ApiModelProperty(value = "报表Itme选项code")
private java.lang.String reportItemCode;
@ApiModelProperty(value = "报表编号")
private java.lang.String reportId;
@ApiModelProperty(value = "负载率类型")
private Integer loadRateType;
}
......
package com.skua.modules.algorithm.vo;
import com.skua.modules.report.vo.FRportlCommandCenterVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="控制中心报表结果接收对象", description="控制中心报表结果接收对象")
public class SysCommandCentreResultVO implements Serializable {
@ApiModelProperty(value = "当前月数据")
private FRportlCommandCenterVO monthData;
@ApiModelProperty(value = "上月数据")
private FRportlCommandCenterVO dayData;
@ApiModelProperty(value = "去年数据")
private FRportlCommandCenterVO yearData;
@ApiModelProperty(value = "统计数据")
private FRportlCommandCenterVO statisticsData;
@ApiModelProperty(value = "总设计规模")
private String totalData;
}
package com.skua.modules.guest.util;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
......@@ -25,6 +27,28 @@ public class DateUtil {
}
/**
* 获取7天日期数据,并指定显示格式
* @param dateFormat
* @return
*/
public List<String> get7Day(String dateFormat) {
if(dateFormat == null ){
dateFormat = "yyyy-MM-dd";
}
LocalDate today = LocalDate.now();
List<String> dates = new ArrayList<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat);
for (int i = 0; i < 7; i++) {
LocalDate date = today.minusDays(i);
dates.add(date.format(formatter));
}
//dates.forEach(System.out::println);
return dates;
}
/**
* 获取今天日期
*
* @return
......@@ -125,5 +149,4 @@ public class DateUtil {
public static LocalDateTime dateToLocalDateTime(Date date){
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
}
}
......
package com.skua.modules.report.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.skua.core.aspect.annotation.Dict;
......@@ -85,4 +86,15 @@ public class FReportItemv {
@ApiModelProperty(value = "标识")
private java.lang.Integer delFlag;
@ApiModelProperty(value = "统计总数")
@TableField(exist = false)
private String sumValue;
@ApiModelProperty(value = "平均总数")
@TableField(exist = false)
private String avgValue;
}
......
......@@ -18,6 +18,14 @@ public interface FReportItemMapper extends BaseMapper<FReportItem> {
List<FReportItem> getListByReportId(@Param("reportId") String reportId);
/**
* 根据 itemCode 与reportId 查询id
* @param reportId
* @param reportItemCode
* @return
*/
public List<String> getReportItemId(@Param("reportId") String reportId,@Param("itemCode") String reportItemCode);
void changeStatus(@Param("id") String id, @Param("required") String required);
List<FReportItem> getItemInfo(@Param("itemAlias") String itemAlias, @Param("reportId") String reportId);
......
package com.skua.modules.report.mapper;
import com.skua.modules.report.vo.DepartLoadRateVO;
import com.skua.modules.report.vo.ReportItemvParam;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.report.entity.FReportItemv;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -32,4 +34,44 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> {
* @author Li Yuanyuan, 2021年5月25日 上午10:34:37
*/
List<FReportItemv> getReportItemvByDataId(String dataId);
/**
* 据reit_id 查询视图表数据 返回总数,平均数
* @param reportItemvParam
* @return
*/
List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam);
/**
* 根据reitId与时间查询
* @param reitId
* @param startDate
* @param endDate
* @return
*/
public FReportItemv getReportItemvByReitIdAndDate(@Param("reitId") String reitId, @Param("startDate") String startDate,@Param("endDate") String endDate);
/**
* 根据类型查询:指挥中心---运行负荷率分析
* @param loadRateType
* @return
*/
public List<DepartLoadRateVO> statisticsByLoadRate(@Param("loadRateType") Integer loadRateType);
/**
* 指挥中心---运行负荷率分析 总数查询
* @param loadRateType
* @return
*/
public int statisticsByLoadRateNum(@Param("loadRateType") Integer loadRateType);
/**
* 根据reitId查询近7天数据
* @param reitId
* @param dateTime
* @return
*/
public List<String> getReportItemvByReitIdAndDate7Day(@Param("reitId") String reitId, @Param("dateTime") String dateTime);
}
......
......@@ -18,6 +18,14 @@
order by sort_num
</select>
<!-- 根据 itemCode 与reportId 查询id -->
<select id="getReportItemId" resultType="java.lang.String">
select id from f_report_item
where report_id = #{reportId} and required='1' and item_code = #{itemCode}
</select>
<update id="changeStatus">
update f_report_item set required = #{required} where id = #{id}
</update>
......
......@@ -40,4 +40,71 @@
</select>
<!-- 根据reit_id 查询视图表数据 返回总数,平均数 -->
<select id="getReportItemvByReitId" resultType="com.skua.modules.report.entity.FReportItemv">
SELECT sum(item_value) 'sum_value' , avg(item_value) 'avg_value', 'DD' as 'itemValue' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
union all
SELECT sum(item_value),avg(item_value) ,'HB' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastMonthStartDate} and data_time &lt;= #{lastMonthEndDate}
union all
SELECT sum(item_value) ,avg(item_value),'TB' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastYearStartDate} and data_time &lt;= #{lastYearEndDate}
</select>
<!-- 根据reit_id 查询视图表数据 返回总数,平均数 -->
<select id="getReportItemvByReitIdAndDate" resultType="com.skua.modules.report.entity.FReportItemv">
SELECT sum(item_value) 'sum_value' , avg(item_value) 'avg_value' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
</select>
<!-- 根据类型查询:指挥中心-运行负荷率分析 -->
<select id="statisticsByLoadRate" resultType="com.skua.modules.report.vo.DepartLoadRateVO">
select aaa.avg_data ,aaa.sum_data 'waterYieldMonth', fi.pro_scale , d.depart_name 'departName' , ROUND(aaa.avg_data / (fi.pro_scale * 100000) , 2) 'loadRate'
from (
select avg(ri.item_value) 'avg_data' ,sum(ri.item_value) 'sum_data' ,ri.depart_id from f_report_itemv ri where ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate} group by ri.depart_id
) aaa
left join sys_factory_info fi on aaa.depart_id = fi.depart_id
left join sys_depart d on d.id = aaa.depart_id
where 1=1
<if test="loadRateType != null and loadRateType == '1'">
and aaa.avg_data / (fi.pro_scale * 100000) &gt;= 60 and aaa.avg_data / (fi.pro_scale * 100000) &lt;= 120
</if>
<if test="loadRateType != null and loadRateType == '2'">
aaa.avg_data / (fi.pro_scale * 100000) &lt; 60
</if>
<if test="loadRateType != null and loadRateType == '3'">
and aaa.avg_data / (fi.pro_scale * 100000) &gt; 120
</if>
order by aaa.avg_data / fi.pro_scale desc limit 10
</select>
<!-- 根据类型查询:指挥中心-运行负荷率分析 -->
<select id="statisticsByLoadRateNum" resultType="java.lang.Integer">
select count(1)
from (
select avg(ri.item_value) 'avg_data' ,sum(ri.item_value) 'sum_data' ,ri.depart_id from f_report_itemv ri where ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate} group by ri.depart_id
) aaa
left join sys_factory_info fi on aaa.depart_id = fi.depart_id
left join sys_depart d on d.id = aaa.depart_id
where 1=1
<if test="loadRateType != null and loadRateType == '1'">
and aaa.avg_data / (fi.pro_scale * 100000) &gt;= 60 and aaa.avg_data / (fi.pro_scale * 100000) &lt;= 120
</if>
<if test="loadRateType != null and loadRateType == '2'">
aaa.avg_data / (fi.pro_scale * 100000) &lt; 60
</if>
<if test="loadRateType != null and loadRateType == '3'">
and aaa.avg_data / (fi.pro_scale * 100000) &gt; 120
</if>
</select>
<!-- 根据reitId查询近7天数据-->
<select id="statisticsByLoadRateNum" resultType="java.lang.Integer">
SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(data_time)
group by data_time
</select>
</mapper>
......
......@@ -2,6 +2,7 @@ package com.skua.modules.report.service;
import com.skua.modules.report.entity.FReportItemv;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.report.vo.ReportItemvParam;
import java.util.Date;
import java.util.List;
......@@ -23,4 +24,13 @@ public interface IFReportItemvService extends IService<FReportItemv> {
boolean isExitDataByTime(String reitId, String dataTime, String departId);
//通过dataId获取填报数据
List<FReportItemv> getReportItemvByDataId(String dataId);
/**
* 据reit_id 查询视图表数据 返回总数,平均数
* @param reportItemvParam
* @return
*/
List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam);
}
......
......@@ -2,8 +2,11 @@ package com.skua.modules.report.service.impl;
import com.skua.common.report.ReportViewUtil;
import com.skua.modules.report.entity.FReportItemv;
import com.skua.modules.report.mapper.FReportItemMapper;
import com.skua.modules.report.mapper.FReportItemvMapper;
import com.skua.modules.report.service.IFReportItemvService;
import com.skua.modules.report.vo.FRportlCommandCenterVO;
import com.skua.modules.report.vo.ReportItemvParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
......@@ -24,6 +27,9 @@ public class FReportItemvServiceImpl extends ServiceImpl<FReportItemvMapper, FRe
@Resource
private FReportItemvMapper fReportItemvMapper;
@Override
public void deleteByDataId(String dataId) {
fReportItemvMapper.deleteByDataId(dataId);
......@@ -71,4 +77,17 @@ public class FReportItemvServiceImpl extends ServiceImpl<FReportItemvMapper, FRe
return fReportItemvMapper.getReportItemvByDataId(dataId);
}
/**
* 据reit_id 查询视图表数据 返回总数,平均数
* @param reportItemvParam
* @return
*/
public List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam){
return fReportItemvMapper.getReportItemvByReitId(reportItemvParam);
}
}
......
package com.skua.modules.report.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="指挥中心--部门运行负荷率接受对象", description="指挥中心--部门运行负荷率接受对象")
public class DepartLoadRateVO implements Serializable{
@ApiModelProperty(value = "项目公司")
private String departName;
@ApiModelProperty(value = "运行负荷率")
private String loadRate;
@ApiModelProperty(value = "达标率")
private String qualifyRate;
@ApiModelProperty(value = "处理水量(吨/月)")
private String waterYieldMonth;
}
package com.skua.modules.report.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="控制中心报表结果接收对象", description="控制中心报表结果接收对象")
public class FRportlCommandCenterVO implements Serializable {
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "结果")
private String value;
/* @ApiModelProperty(value = "最大值")
private Object maxValue;
@ApiModelProperty(value = "最小值")
private Object minValue;*/
@ApiModelProperty(value = "上月同期")
private String valueTb;
@ApiModelProperty(value = "去年同期")
private String valueHb;
/* @ApiModelProperty(value = "同比比例")
private Object valueTbProportion;
@ApiModelProperty(value = "同比差值")
private Object valueTbDifference;
@ApiModelProperty(value = "环比比例")
private Object valueHbProportion;
@ApiModelProperty(value = "环比差值")
private Object valueHbDifference;
@ApiModelProperty(value = "上期")
private Object valuePre;
@ApiModelProperty(value = "上期比例")
private Object valuePreProportion;
@ApiModelProperty(value = "上期差值")
private Object valuePreDifference;
@ApiModelProperty(value = "单位")
private String unit;*/
}
package com.skua.modules.report.vo;
import com.skua.core.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.text.ParseException;
import java.util.Calendar;
/**
* ReportItemvParam 查询参数
*/
@Data
@ApiModel(value="统计结果查询对象", description="统计结果查询对象")
public class ReportItemvParam implements Serializable{
@ApiModelProperty(value = "报表数据项id")
public String reitId;
@ApiModelProperty(value = "报表编号")
private java.lang.String reportId;
@ApiModelProperty(value = "报表Itme选项code")
private java.lang.String reportItemCode;
/**开始时间*/
@ApiModelProperty(value = "开始时间")
private java.lang.String startDate;
@ApiModelProperty(value = "结束时间")
private java.lang.String endDate;
@ApiModelProperty(value = "上月开始时间")
private java.lang.String lastMonthStartDate;
@ApiModelProperty(value = "上月结束时间")
private java.lang.String lastMonthEndDate;
@ApiModelProperty(value = "去年开始时间")
private java.lang.String lastYearStartDate;
@ApiModelProperty(value = "去年结束时间")
private java.lang.String lastYearEndDate;
/**
* 初始化数据
* @param startTime
* @param endTime
*/
public ReportItemvParam(String reportId ,String reportItemCode ,String startTime , String endTime){
try {
this.reitId = reportId;
this.reportItemCode = reportItemCode;
if(startTime != null && startTime.length() > 0 ){
this.startDate = startTime;
this.lastMonthStartDate = DateUtils.formatAddTime(startTime, "yyyy-MM-dd", Calendar.MONTH, -1);
this.lastYearStartDate = DateUtils.formatAddTime(startTime, "yyyy-MM-dd", Calendar.YEAR, -1);
}
if(endTime != null && endTime.length() > 0 ){
this.endDate = endTime;
this.lastMonthEndDate = DateUtils.formatAddTime(endTime, "yyyy-MM-dd", Calendar.MONTH, -1);
this. lastYearEndDate = DateUtils.formatAddTime(endTime, "yyyy-MM-dd", Calendar.YEAR, -1);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
}
......@@ -90,4 +90,10 @@ public interface SysFactoryInfoMapper extends BaseMapper<SysFactoryInfo> {
@Select("SELECT d.id as depart_id, d.depart_name AS NAME,d.depart_name AS depart_name,d.depart_type,(select depart_name from sys_depart sd where d.parent_id = sd.id )areaName,f.* FROM sys_depart d LEFT JOIN sys_factory_info f ON f.depart_id = d.id ${customSqlSegment}")
List<SysFactoryInfoVO> getFactoryListByWrapper(QueryWrapper queryWrapper);
/**
* 获取总的设计规模
* @return
*/
public String querySumProScale();
}
......
......@@ -489,4 +489,9 @@
WHERE
alarm_program_code = #{id}
</select>
<!-- 获取总的设计规模-->
<select id="" resultType="java.lang.String">
select sum(pro_scale) from sys_factory_info
</select>
</mapper>
......
......@@ -101,4 +101,12 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> {
void exitNew(SysFactoryInfoNewVO sysFactoryInfoNewVO);
List<SysFactoryInfoVO> getFactoryListByWrapper(QueryWrapper<SysFactoryInfoVO> queryWrapper);
/**
* 获取总的设计规模
* @return
*/
public String querySumProScale();
}
......
......@@ -665,4 +665,12 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper,
return sysFactoryInfo;
}
/**
* 获取总的设计规模
* @return
*/
public String querySumProScale(){
return sysFactoryInfoMapper.querySumProScale();
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!