c7efce94 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 920eab55 95904530
......@@ -14,6 +14,7 @@ import com.skua.tool.util.DigitalUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -116,17 +117,12 @@ public class SysCommandCentreController {
public Result<DepartLoadRateResultVO> statisticsByLoadRate(ReportItemvParam reportItemvParam) throws Exception {
DepartLoadRateResultVO loadRateResultVO = new DepartLoadRateResultVO();
//SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
//报表数据项值
String reitId = sysConfigService.queryValueByKey("REIT_ID_CSL");
reportItemvParam.setReitId( reitId );
Integer loadRateType = 1;//默认查询
if(reportItemvParam.getLoadRateType() != null){
loadRateType = reportItemvParam.getLoadRateType();
}else{
reportItemvParam.setLoadRateType(loadRateType);
if(reportItemvParam.getLoadRateType() == null){
reportItemvParam.setLoadRateType(1);////默认查询
}
List<DepartLoadRateVO> departLoadRateVOList = commandCentreService.statisticsByLoadRate(reportItemvParam);
......@@ -138,8 +134,8 @@ public class SysCommandCentreController {
loadRateResultVO.setDepartLoadRateVOList(departLoadRateVOList );
//统计总数
int normalNum = commandCentreService.statisticsByLoadRateNum(1, reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//正常
int lowLoadNum = commandCentreService.statisticsByLoadRateNum(2 ,reitId , reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//低负荷
int overloadNum = commandCentreService.statisticsByLoadRateNum(3 , reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//超负荷
int lowLoadNum = commandCentreService.statisticsByLoadRateNum(3 ,reitId , reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//低负荷
int overloadNum = commandCentreService.statisticsByLoadRateNum(2 , reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//超负荷
loadRateResultVO.setNormalNum( normalNum );
loadRateResultVO.setLowLoadNum( lowLoadNum );
loadRateResultVO.setOverloadNum( overloadNum );
......
......@@ -84,6 +84,9 @@ public class DistributContractController {
Result<List<DistributContract>> result = new Result<List<DistributContract>>();
QueryWrapper<DistributContract> queryWrapper = QueryGenerator.initQueryWrapper(distributContract, req.getParameterMap());
// 需要添加条件判断
queryWrapper.eq("status" , "3");// 审核通过
List<DistributContract> dataList = distributContractService.list(queryWrapper);
result.setSuccess(true);
result.setResult(dataList);
......
......@@ -145,9 +145,9 @@ public class MaterialINController {
if(StringUtils.isNotBlank(materialIN.getAuditStatus())){
queryWrapper.eq("audit_status",materialIN.getAuditStatus());
}
if(StringUtils.isNotBlank(materialIN.getConfirmStatus())){
/*if(StringUtils.isNotBlank(materialIN.getConfirmStatus())){
queryWrapper.eq("confirm_status",materialIN.getConfirmStatus());
}
}*/
if(StringUtils.isNotBlank(materialIN.getGoodCode())){
queryWrapper.like("good_code",materialIN.getGoodCode());
}
......@@ -157,7 +157,13 @@ public class MaterialINController {
if(StringUtils.isNotBlank(materialIN.getEndTime())){
queryWrapper.le("arrive_time",materialIN.getEndTime());
}
queryWrapper.gt("audit_tatus",0);
// 需要添加条件判断
queryWrapper.gt("status" , "0");// >0
queryWrapper.ne("status" , "2"); // 不等于2
queryWrapper.eq("confirm_status","2");
IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -66,6 +66,9 @@ public class PurchaseContractController {
Page<ERPPurchaseContract> page = new Page<ERPPurchaseContract>(pageNo, pageSize);
// 需要添加条件判断
queryWrapper.gt("status" , "0");// >0
queryWrapper.ne("status" , "2"); // 不等于2
IPage<ERPPurchaseContract> pageList = purchaseContractService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -301,8 +301,9 @@ public class PurchasePlanController {
if(sparepartTypeSet.size() > 0 ){
// 使用String.join()方法转换Set为字符串,以逗号分隔
sparepartTypeStr = String.join(",", sparepartTypeSet);
}
purchasePlanSearchVO.setSparepartType( sparepartTypeStr );
purchasePlanSearchVO.setSparepartType( sparepartTypeStr );
}
log.debug("查询物料子分类集合:{}",sparepartTypeStr);
//查询下一级部门集合
......@@ -316,7 +317,7 @@ public class PurchasePlanController {
purchasePlanSearchVO.setDepartIds( departIds );
log.debug("查询部门集合:{}",departIds);
}else{
purchasePlanSearchVO.setDepartIds( BaseContextHandler.getDeparts() );
purchasePlanSearchVO.setDepartIds( BaseUtil.quoteEach(BaseContextHandler.getDeparts(),",") );
log.debug("查询权限部门集合:{}", BaseUtil.quoteEach(BaseContextHandler.getDeparts(),","));
}
}
......
......@@ -27,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors(chain = true)
@ApiModel(value="erp_purchase_plan对象", description="erp采购计划表")
public class PurchasePlan implements Serializable{
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
......@@ -98,4 +98,7 @@ public class PurchasePlan implements Serializable{
/**审批意见*/
@ApiModelProperty(value = "审批意见")
private String approveMessage;
@ApiModelProperty(value = "备注")
private String remark ;
}
......
......@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors(chain = true)
@ApiModel(value="erp_purchase_plan_item对象", description="采购计划物料清单")
public class PurchasePlanItem implements Serializable{
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
......@@ -37,7 +37,7 @@ public class PurchasePlanItem implements Serializable{
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
//@Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text")
@Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text")
private String sparepartType;
/**物料编号*/
......@@ -46,7 +46,7 @@ public class PurchasePlanItem implements Serializable{
private String sparepartName;
@ApiModelProperty(value = "物料编号")
//@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
private String sparepartId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
......
......@@ -54,7 +54,7 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
}
}
}
if(errMsg != null ){
if(errMsg == null ){
int count = this.baseMapper.insert( distributContractVO );
if(count > 0 && distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){
for(DistributMaterial material : distributContractVO.getMaterialList()){
......
package com.skua.modules.process.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.modules.equipment.entity.EquipmentMaintainTask;
import com.skua.modules.equipment.service.IEquipmentMaintainTaskService;
import com.skua.modules.flow.business.service.FlowBusinessService;
import com.skua.modules.flow.core.entity.BladeFlow;
import com.skua.modules.flow.core.utils.TaskUtil;
import com.skua.modules.flow.utils.Func;
import com.skua.modules.inspection.entity.InspectionUserWorkingGroup;
import com.skua.modules.inspection.service.IInspectionTaskService;
import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService;
......@@ -17,12 +21,9 @@ import com.skua.modules.quartz.util.BaseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.flowable.task.api.TaskQuery;
import org.flowable.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -35,9 +36,8 @@ import java.util.List;
@RequestMapping("/web/process")
public class ProcessStatisticsController {
// 注入TaskService
@Autowired
private TaskService taskService;
private FlowBusinessService flowBusinessService;
@Autowired
private IEquipmentMaintainTaskService equipMaintainExecuteService;
@Autowired
......@@ -60,36 +60,45 @@ public class ProcessStatisticsController {
public Result<List<ProcessStatisticsVO>> statistics() {
Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>();
List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>();
String taskUser = TaskUtil.getTaskUser();
String taskGroup = TaskUtil.getCandidateGroup();
List<String> userGroupList = Func.toStrList(taskGroup);
/* String taskUser = TaskUtil.getTaskUser();
String taskGroup = TaskUtil.getCandidateGroup();*/
String userId = BaseContextHandler.getUserId();
IPage<BladeFlow> page = new Page<BladeFlow>();
page.setCurrent(1);
page.setSize(10000);
BladeFlow bladeFlow = new BladeFlow();
try {
//巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库
// 、、、、、药剂入库
String process_key = "AjhRectification";
processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,taskUser,taskGroup) ) ;
processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,page,bladeFlow) ) ;
process_key = "problemReport";
processStatisticsList.add( queryProcessStatistics("问题上报", process_key,taskUser,taskGroup)) ;
processStatisticsList.add( queryProcessStatistics("问题上报", process_key,page,bladeFlow)) ;
process_key = "EmergencyRiskEvent";
processStatisticsList.add( queryProcessStatistics("事故事件", process_key,taskUser,taskGroup) ) ;
processStatisticsList.add( queryProcessStatistics("事故事件", process_key,page,bladeFlow) ) ;
process_key = "DangerousOperationManage";
processStatisticsList.add( queryProcessStatistics("危险作业", process_key,taskUser,taskGroup) ) ;
processStatisticsList.add( queryProcessStatistics("危险作业", process_key,page,bladeFlow) ) ;
process_key = "EquipmentRepair";
processStatisticsList.add( queryProcessStatistics("维修任务", process_key,taskUser,taskGroup)) ;
processStatisticsList.add( queryProcessStatistics("维修任务", process_key,page,bladeFlow)) ;
Integer todoCount = 0;
Integer baoyangTodoCount = 0;
QueryWrapper equipmentMaintainTaskQueryWrapper = new QueryWrapper<EquipmentMaintainTask>();
equipmentMaintainTaskQueryWrapper.eq("maintainer_id", taskUser);
equipmentMaintainTaskQueryWrapper.eq("results_enforcement", 1);
todoCount = equipMaintainExecuteService.count(equipmentMaintainTaskQueryWrapper);
ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", todoCount.toString() );
equipmentMaintainTaskQueryWrapper.eq("maintainer_id", userId);
//equipmentMaintainTaskQueryWrapper.eq("results_enforcement", 1);
baoyangTodoCount = equipMaintainExecuteService.count(equipmentMaintainTaskQueryWrapper);
ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", baoyangTodoCount.toString() );
processStatisticsList.add( maintainerProcessStatisticsVO );
//巡检
//得到巡检任务
//得到进行中的任务
//获取用户所在的班组
Integer xunjian_count = 0;
String userId = BaseContextHandler.getUserId();
QueryWrapper<InspectionUserWorkingGroup> inspectionUserWorkingGroupQueryWrapper = new QueryWrapper<>();
inspectionUserWorkingGroupQueryWrapper.eq("user_id", userId);
List<InspectionUserWorkingGroup> inspectionUserWorkingGroupList = inspectionUserWorkingGroupService.list(inspectionUserWorkingGroupQueryWrapper);
......@@ -106,7 +115,11 @@ public class ProcessStatisticsController {
} else {
xunjian_count = 0;
}
ProcessStatisticsVO xunjianProcessStatisticsVO = new ProcessStatisticsVO("巡检任务" ,"" , "0",xunjian_count.toString() );
//得到当前未开始的
String moduleType = "1";
List<JSONObject> inspectionTaskByUserIdList = inspectionTaskService.getInspectionTaskByUserId(userId, moduleType);
ProcessStatisticsVO xunjianProcessStatisticsVO = new ProcessStatisticsVO("巡检任务" ,"" , "0", inspectionTaskByUserIdList.size()+"" );
processStatisticsList.add( xunjianProcessStatisticsVO );
......@@ -114,13 +127,20 @@ public class ProcessStatisticsController {
String userRoleIds = BaseContextHandler.getRoles();
String roleIds = BaseUtil.quoteEach(userRoleIds,",");
Integer materialINCount = 0;
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
StringBuffer sql = new StringBuffer(" select count(1) from sys_role_permission rp ,sys_config c ");
sql.append(" where rp.permission_id = c.config_value and c.config_id = 'MaterialIN_ID' and rp.role_id in ("+roleIds+") " );
Integer authFlag = masterDB.queryForObject(sql.toString(),Integer.class);
Integer materialINCount = 0;
Integer authFlag = 0;
//如果为管理员,则跳过权限
if ("1".equals(BaseContextHandler.get("userType"))) {
authFlag = 1;
}else{
StringBuffer sql = new StringBuffer(" select count(1) from sys_role_permission rp ,sys_config c ");
sql.append(" where rp.permission_id = c.config_value and c.config_id = 'MaterialIN_ID' and rp.role_id in ("+roleIds+") " );
authFlag = masterDB.queryForObject(sql.toString(),Integer.class);
}
if(authFlag.intValue() > 0){
String sql2 = "select count(1) from erp_material_in where confirm_status =2 and audit_status>0 and audit_status<3";
String sql2 = "select count(1) from erp_material_in where confirm_status =2 and audit_status>0 and audit_status<3 and apply_time >= '"+BaseUtil.getLastYearDate()+"' and apply_time<='"+BaseUtil.getCurrentDate()+"' ";
materialINCount = masterDB.queryForObject(sql2,Integer.class);
}
......@@ -140,11 +160,22 @@ public class ProcessStatisticsController {
* @param process_key
* @return
*/
private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){
/* private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){
TaskQuery taskQuery = taskService.createTaskQuery();
taskQuery.processDefinitionKey( process_key );
Long todoCount = taskQuery.taskAssignee(taskUser).count();//代办人数
Long claimCount = taskQuery.taskCandidateGroupIn( Func.toStrList(taskGroup) ).count() ;//todoCount
return new ProcessStatisticsVO(processName ,process_key , todoCount.toString(), claimCount.toString() );
}*/
private ProcessStatisticsVO queryProcessStatistics(String processName, String process_key, IPage<BladeFlow> page,BladeFlow bladeFlow){
// String repairProcessDefinitionKey = "equipServicewx";
bladeFlow.setProcessDefinitionKey(process_key);
long repairClaimCount = flowBusinessService.selectClaimPage(page, bladeFlow).getTotal();
long repairToDoCount = flowBusinessService.selectTodoPage(page, bladeFlow).getTotal();
// long repairDoneCount = flowBusinessService.selectDonePage(page, bladeFlow).getTotal();
return new ProcessStatisticsVO(processName ,process_key , repairToDoCount+"", repairClaimCount+"" );
}
}
......
......@@ -21,7 +21,7 @@ public class ProcessStatisticsVO {
private String totalCount;
public String getTotalCount() {
return DigitalUtils.add( this.getTotalCount() , this.getClaimCount() ) ;
return DigitalUtils.add( this.getTodoCount() , this.getClaimCount() ) ;
}
public ProcessStatisticsVO(){
......
......@@ -186,6 +186,30 @@ public class BaseUtil {
return defaultStartDate;
}
public static String getCurrentDate() {
Date dNow = new Date(); // 当前时间
Calendar calendar = Calendar.getInstance(); // 得到日历
calendar.setTime(dNow);// 把当前时间赋给日历
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 设置时间格式
String defaultStartDate = sdf.format(calendar); // 格式化时间
// String defaultEndDate = sdf.format(dNow); //格式化当前时间
return defaultStartDate;
}
public static String getLastYearDate() {
Date dNow = new Date(); // 当前时间
Date dBefore = null;//new Date();
Calendar calendar = Calendar.getInstance(); // 得到日历
calendar.setTime(dNow);// 把当前时间赋给日历
//calendar.add(Calendar.DAY_OF_MONTH, -1); // 设置为前一天
calendar.add(Calendar.YEAR, -1); // 设置为上一年
dBefore = calendar.getTime(); // 得到去年的时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 设置时间格式
String defaultStartDate = sdf.format(dBefore); // 格式化时间
// String defaultEndDate = sdf.format(dNow); //格式化当前时间
return defaultStartDate;
}
/**
* 保留两位小数
*
......
......@@ -158,8 +158,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
return valueMapList;
}
/*public List<Map<String, Object>> getDataFromHY(String year, String departId,String startTime,String endTime) {
List<Map<String, Object>> valueMapList = new ArrayList<>();
String tbYear = String.valueOf(Integer.parseInt(year) - 1);
......@@ -273,7 +271,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
//节能环保 大屏展示
public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){
//long startTime = System.nanoTime();
long startTime = System.nanoTime();
JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
//当月数据
String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
......@@ -298,10 +296,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
LoadRateVO loadRateVO = null;
PowerConsumeVO powerConsumeVO = null;
ResultNumberVO c02NumberVO = null;//CO2排放对象
ResultNumberVO cod_NumberVO = null;//COD
ResultNumberVO nh3n_NumberVO = null;//NH3-N
ResultNumberVO tp_NumberVO = null;//TP
ResultNumberVO tn_NumberVO = null;//TN
List<PowerConsumeVO> powerConsumeVOList = new ArrayList();//各站点能源消耗排名
List<LoadRateVO> loadRateVOList = new ArrayList<>();//负荷率对象
......@@ -311,54 +305,53 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData
JnhbReportData lastYearReportDataTemp ;//lastYearMapData
ResultChartsVO energyConsumeChart = null;
JnhbLargeScreenExpressionVO largeScreenExpressionVO = new JnhbLargeScreenExpressionVO();//表达式
for(JnhbReportData reportData : jnhbReportDataList){
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValue( reportData);
lastMonthReportDataTemp = lastMonthMapData.get(reportData.getDepartId());
lastYearReportDataTemp = lastYearMapData.get(reportData.getDepartId());
//largeScreenVO.setHeadStatisticsValue( reportData);
//largeScreenExpressionVO.setHeadStatisticsValue(reportData);
largeScreenExpressionVO.setHeadStatisticsValue(reportData );
lastMonthReportDataTemp = lastMonthMapData.get(reportData.getDepartId());// 上月环比
lastYearReportDataTemp = lastYearMapData.get(reportData.getDepartId());// 去年 同比
//各站点系统负荷率排名:
loadRateVO = new LoadRateVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getWsclgm(),reportData.getWssjcll(),reportData.getWsfhl());
//各站点能源消耗排名:
powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() );
c02NumberVO = new ResultNumberVO();
c02NumberVO.setName( reportData.getDepartName() );
c02NumberVO.setValue( reportData.getCodxjl() );
cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl());
nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl());
tp_NumberVO = new ResultNumberVO();tp_NumberVO.setValue(reportData.getTpxjl());
tn_NumberVO = new ResultNumberVO();tn_NumberVO.setValue(reportData.getTnxjl());
largeScreenExpressionVO.setReduceStatistics(reportData);
/*************同比环比数据设置****************/
if ( lastMonthReportDataTemp != null ){
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValueHB( lastMonthReportDataTemp);
//largeScreenVO.setHeadStatisticsValueHB( lastMonthReportDataTemp);
largeScreenExpressionVO.setHeadStatisticsValueHB( lastMonthReportDataTemp);
loadRateVO.setValueHb(lastMonthReportDataTemp.getWsfhl() );
powerConsumeVO.setValueHb(lastMonthReportDataTemp.getDsdh() );
c02NumberVO.setValueHb(lastMonthReportDataTemp.getCodxjl() );
cod_NumberVO.setValueHb(reportData.getCodxjl());
nh3n_NumberVO.setValueHb(reportData.getTnxjl());
tp_NumberVO.setValueHb(reportData.getTpxjl());
tn_NumberVO.setValueHb(reportData.getTnxjl());
//消减量统计 环比
largeScreenExpressionVO.setReduceStatisticsHB(reportData);
}
if ( lastYearReportDataTemp != null ){
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValueTB( lastYearReportDataTemp);
//largeScreenVO.setHeadStatisticsValueTB( lastYearReportDataTemp);
largeScreenExpressionVO.setHeadStatisticsValueTB( lastYearReportDataTemp );
loadRateVO.setValueHb(lastYearReportDataTemp.getWsfhl() );
powerConsumeVO.setValueHb(lastYearReportDataTemp.getDsdh() );
c02NumberVO.setValueHb(lastYearReportDataTemp.getCodxjl() );
cod_NumberVO.setValueHb(reportData.getCodxjl());
nh3n_NumberVO.setValueHb(reportData.getTnxjl());
tp_NumberVO.setValueHb(reportData.getTpxjl());
tn_NumberVO.setValueHb(reportData.getTnxjl());
//消减量统计 同比
largeScreenExpressionVO.setReduceStatisticsTB(reportData);
}
//loadRateVO.setValue(reportData.getWsfhl(),valueHb,valueTb );
largeScreenVO.getLoadRateVOList().add(loadRateVO );
largeScreenVO.getPowerConsumeVOList().add( powerConsumeVO );
loadRateVOList.add(loadRateVO );
powerConsumeVOList.add( powerConsumeVO );
//ESG减排趋势
energyConsumeChart = new ResultChartsVO();
......@@ -370,17 +363,39 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
largeScreenVO.getEnergyConsumeChartsList().add( energyConsumeChart ) ;
//消减量统计
largeScreenVO.setReduceStatistics(1,cod_NumberVO);
/*largeScreenVO.setReduceStatistics(1,cod_NumberVO);
largeScreenVO.setReduceStatistics(2,nh3n_NumberVO);
largeScreenVO.setReduceStatistics(3,tp_NumberVO);
largeScreenVO.setReduceStatistics(4,tn_NumberVO);
largeScreenVO.setReduceStatistics(4,tn_NumberVO);*/
largeScreenExpressionVO.setReduceStatistics(reportData);
//CO2排放排名
largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
co2DataList.add( c02NumberVO );
//排放指标
// String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl
wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ;
}
largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
//设置计算表达式
largeScreenVO.setLargeScreenExpressionVO( largeScreenExpressionVO );
//头文件Head
//largeScreenVO.setHeadStatisticsValueTB();
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValue( );
//各站点能源消耗排名
largeScreenVO.setPowerConsumeVOList( powerConsumeVOList );
//负荷率对象
largeScreenVO.setLoadRateVOList( loadRateVOList );
//消减量统计
largeScreenVO.setReduceStatistics();
//CO2排放排名
largeScreenVO.setCo2DataList( co2DataList ) ;
//largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
//废物处理对象集合
largeScreenVO.setWasteMaterialList( wasteMaterialList ) ;
//System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
//主库数据源
......@@ -391,6 +406,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class);
largeScreenVO.setEquipmentL2( count2 );
//System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
// 各站点系统负荷率排名:负荷率排序、设置排名
/* if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){
// 根据分数排序
......@@ -404,7 +420,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
loadRateVORank.setRank( rank++);
}*//*
}*/
//各站点能源消耗排名 吨水电耗
//各站点能源消耗排名 吨水电耗
/*if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) {
// 根据分数排序
Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() {
......
......@@ -75,10 +75,10 @@
<if test="loadRateType != null and loadRateType == 1">
avg(ri.item_value)/(100*fi.pro_scale) &gt;= 60 and avg(ri.item_value)/(100*fi.pro_scale) &lt;= 120
</if>
<if test="loadRateType != null and loadRateType == 2">
<if test="loadRateType != null and loadRateType == 3">
avg(ri.item_value)/(100*fi.pro_scale) &lt; 60
</if>
<if test="loadRateType != null and loadRateType == 3">
<if test="loadRateType != null and loadRateType == 2">
avg(ri.item_value)/(100*fi.pro_scale) &gt; 120
</if>
</trim>
......@@ -99,10 +99,10 @@
<if test="loadRateType != null and loadRateType == 1">
avg(ri.item_value)/(100*fi.pro_scale) &gt;= 60 and avg(ri.item_value)/(100*fi.pro_scale) &lt;= 120
</if>
<if test="loadRateType != null and loadRateType == 2">
<if test="loadRateType != null and loadRateType == 3">
avg(ri.item_value)/(100*fi.pro_scale) &lt; 60
</if>
<if test="loadRateType != null and loadRateType == 3">
<if test="loadRateType != null and loadRateType == 2">
avg(ri.item_value)/(100*fi.pro_scale) &gt; 120
</if>
</trim>
......
......@@ -2,6 +2,7 @@ package com.skua.modules.report.vo;
import com.skua.modules.report.vo.largeScreen.*;
import com.skua.tool.util.DigitalUtils;
import com.skua.tool.util.JSUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -16,7 +17,7 @@ import java.util.List;
@ApiModel(value="生产运营--大屏对象", description="生产运营--月度生产数据报表")
public class JnhbLargeScreenVO {
@ApiModelProperty(value = "头部统计数值")
private List<ResultNumberVO> headStatisticsList = new ArrayList<>(8);
private List<ResultNumberVO> headStatisticsList = new ArrayList<>();
@ApiModelProperty(value = "各站点能源消耗排名")
private List<PowerConsumeVO> powerConsumeVOList = new ArrayList();
......@@ -44,50 +45,48 @@ public class JnhbLargeScreenVO {
private Integer equipmentL1;
@ApiModelProperty(value = "二级能耗设备")
private Integer equipmentL2;
private JnhbLargeScreenExpressionVO largeScreenExpressionVO;
/***
* 设置消减统计记录
* 设置头文件
*/
public void setHeadStatisticsValue(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().get(0).setValue( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValue() , reportData.getWssjcll()) );
this.getHeadStatisticsList().get(1).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValue() , reportData.getWsfhl()) );
this.getHeadStatisticsList().get(2).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValue() , reportData.getDh() ));
this.getHeadStatisticsList().get(3).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValue() , reportData.getQy()) );
this.getHeadStatisticsList().get(4).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValue() , reportData.getXssyl()) );
this.getHeadStatisticsList().get(5).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValue() , reportData.getZhnyxhl()) );
this.getHeadStatisticsList().get(6).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValue() , reportData.getEyhtpfl() ));
this.getHeadStatisticsList().get(7).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValue() , reportData.getDsdh() ));
}
public void setHeadStatisticsValueTB(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().get(0).setValueTb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueTb() , reportData.getWssjcll()) );
this.getHeadStatisticsList().get(1).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueTb() , reportData.getWsfhl()) );
this.getHeadStatisticsList().get(2).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueTb() , reportData.getDh() ));
this.getHeadStatisticsList().get(3).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueTb() , reportData.getQy()) );
this.getHeadStatisticsList().get(4).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueTb() , reportData.getXssyl()) );
this.getHeadStatisticsList().get(5).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueTb() , reportData.getZhnyxhl()) );
this.getHeadStatisticsList().get(6).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueTb() , reportData.getEyhtpfl() ));
this.getHeadStatisticsList().get(7).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueTb() , reportData.getDsdh() ));
}
public void setHeadStatisticsValueHB(JnhbReportData reportData){
public void setHeadStatisticsValue(){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().get(0).setValueHb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueHb() , reportData.getWssjcll()) );
this.getHeadStatisticsList().get(1).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueHb() , reportData.getWsfhl()) );
this.getHeadStatisticsList().get(2).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueHb() , reportData.getDh() ));
this.getHeadStatisticsList().get(3).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueHb() , reportData.getQy()) );
this.getHeadStatisticsList().get(4).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueHb() , reportData.getXssyl()) );
this.getHeadStatisticsList().get(5).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueHb() , reportData.getZhnyxhl()) );
this.getHeadStatisticsList().get(6).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueHb() , reportData.getEyhtpfl() ));
this.getHeadStatisticsList().get(7).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueHb() , reportData.getDsdh() ));
this.getHeadStatisticsList().add( getResultNumberVO( "wssjcll", this.getLargeScreenExpressionVO().getHead_wssjcll_expression() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_hb() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_tb()) );//污水处理量
this.getHeadStatisticsList().add( getResultNumberVO( "wsfhl",this.getLargeScreenExpressionVO().getHead_wsfhl_expression() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_tb()) );//系统负荷率
this.getHeadStatisticsList().add( getResultNumberVO( "dh",this.getLargeScreenExpressionVO().getHead_dh_expression() , this.getLargeScreenExpressionVO().getHead_dh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dh_expression_tb()) );//电耗
this.getHeadStatisticsList().add( getResultNumberVO( "qy",this.getLargeScreenExpressionVO().getHead_qy_expression() , this.getLargeScreenExpressionVO().getHead_qy_expression_hb() , this.getLargeScreenExpressionVO().getHead_qy_expression_tb()) );//汽油
this.getHeadStatisticsList().add( getResultNumberVO( "xinshui",this.getLargeScreenExpressionVO().getHead_xssyl_expression() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_hb() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_tb()) );//薪水
this.getHeadStatisticsList().add( getResultNumberVO( "zhnyxhl",this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_tb()) );//综合能耗
this.getHeadStatisticsList().add( getResultNumberVO( "eyhtpfl",this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_hb() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_tb()) );//C02
this.getHeadStatisticsList().add( getResultNumberVO( "dsdh",this.getLargeScreenExpressionVO().getHead_dsdh_expression() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_tb()) );//吨水电耗
}
/***
* 设置:消减统计记录
*/
public void setReduceStatistics(){
this.getReduceStatisticsList().add( getResultNumberVO( "cod",this.getLargeScreenExpressionVO().getReduce_statistics_cod() , this.getLargeScreenExpressionVO().getReduce_statistics_cod_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_cod_tb()) );//吨水电耗
this.getReduceStatisticsList().add( getResultNumberVO( "NH3-N",this.getLargeScreenExpressionVO().getReduce_statistics_nh3n() , this.getLargeScreenExpressionVO().getReduce_statistics_nh3n_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_nh3n_tb()) );//吨水电耗
this.getReduceStatisticsList().add( getResultNumberVO( "TP",this.getLargeScreenExpressionVO().getReduce_statistics_tp() , this.getLargeScreenExpressionVO().getReduce_statistics_tp_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_tp_tb()) );//吨水电耗
this.getReduceStatisticsList().add( getResultNumberVO( "TN",this.getLargeScreenExpressionVO().getReduce_statistics_tn() , this.getLargeScreenExpressionVO().getReduce_statistics_tn_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_tn_tb()) );//吨水电耗
}
private ResultNumberVO getResultNumberVO(String name , String valueExpression ,String valueHbExpression,String valueTbExpression){
ResultNumberVO head_wssjcll = new ResultNumberVO();//污水处理量
//head_wssjcll.setName( name);
head_wssjcll.setValue( JSUtils.executeExpression(valueExpression , "0") );
head_wssjcll.setValueHb( JSUtils.executeExpression( valueHbExpression , "0") );
head_wssjcll.setValueTb(JSUtils.executeExpression( valueTbExpression , "0") );
return head_wssjcll;
}
public void setReduceStatistics(int index , ResultNumberVO resultNumberVO){
ResultNumberVO resultNumberVOTemp = reduceStatisticsList.get( index - 1);
resultNumberVOTemp.setValue(DigitalUtils.add(resultNumberVOTemp.getValue() , resultNumberVO.getValue() ) );
......@@ -97,7 +96,7 @@ public class JnhbLargeScreenVO {
public JnhbLargeScreenVO(){
//头部数值统计
/*//头部数值统计
String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水";
String unit = "万吨,%,万千瓦时,吨,吨,吨标准煤,吨CO2当量,千瓦时/吨";
String[] nameList = names.split(",");
......@@ -109,7 +108,6 @@ public class JnhbLargeScreenVO {
numberVO.setUnit(unitList[i] );
this.getHeadStatisticsList().add(numberVO) ;
}
//消减量统计
names= "COD,NH3-N,TP,TN";
nameList = names.split(",");
......@@ -117,10 +115,7 @@ public class JnhbLargeScreenVO {
numberVO = new ResultNumberVO();
numberVO.setName( name);
this.getReduceStatisticsList().add(numberVO) ;
}
}*/
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!